Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / ACE / apps / JAWS2 / JAWS / Reaper.h
blobb29211eb7288587f1de9b80d3ecf85067ba6c938
1 /* -*- c++ -*- */
2 #ifndef JAWS_REAPER_H
3 #define JAWS_REAPER_H
5 #include "ace/Singleton.h"
7 #if !defined (ACE_LACKS_PRAGMA_ONCE)
8 # pragma once
9 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 #include "ace/Task.h"
12 #include "ace/Synch_Traits.h"
14 #include "JAWS/Export.h"
16 // A reaper class to reap the threads.
18 class JAWS_Concurrency_Base;
20 /**
21 * Reap threads for the concurrency strategies
23 * The JAWS_Reaper uses the default Thread Manager (while each
24 * concurrency strategy uses their own). The idea is that the
25 * reaper will spawn a thread to reap the threads of a concurrency
26 * strategy. This allows the main thread to reap the threads of
27 * the reaper before exiting.
29 class JAWS_Export JAWS_Reaper : public ACE_Task<ACE_SYNCH>
31 public:
32 JAWS_Reaper (JAWS_Concurrency_Base *concurrency);
33 virtual ~JAWS_Reaper (void);
35 virtual int open (void * = 0);
36 virtual int svc (void);
38 private:
39 JAWS_Concurrency_Base *concurrency_;
40 int waiting_;
41 ACE_SYNCH_MUTEX lock_;
45 #endif /* JAWS_REAPER_H */