summaryrefslogtreecommitdiff
path: root/ACE/apps/JAWS2/JAWS/Reaper.cpp
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:30 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:30 +0000
commitc44379cc7d9c7aa113989237ab0f56db12aa5219 (patch)
tree66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/apps/JAWS2/JAWS/Reaper.cpp
parent3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff)
downloadATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz
Repo restructuring
Diffstat (limited to 'ACE/apps/JAWS2/JAWS/Reaper.cpp')
-rw-r--r--ACE/apps/JAWS2/JAWS/Reaper.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/ACE/apps/JAWS2/JAWS/Reaper.cpp b/ACE/apps/JAWS2/JAWS/Reaper.cpp
new file mode 100644
index 00000000000..6d1d5845cba
--- /dev/null
+++ b/ACE/apps/JAWS2/JAWS/Reaper.cpp
@@ -0,0 +1,45 @@
+// $Id$
+
+#include "JAWS/Reaper.h"
+#include "JAWS/Concurrency.h"
+#include "JAWS/IO_Acceptor.h"
+
+ACE_RCSID(JAWS, Reaper, "$Id$")
+
+JAWS_Reaper::JAWS_Reaper (JAWS_Concurrency_Base *concurrency)
+ : concurrency_ (concurrency),
+ waiting_ (0)
+{
+}
+
+JAWS_Reaper::~JAWS_Reaper (void)
+{
+}
+
+int
+JAWS_Reaper::open (void *)
+{
+ if (this->waiting_ == 0)
+ {
+ ACE_Guard<ACE_SYNCH_MUTEX> g (this->lock_);
+ if (this->waiting_ == 0)
+ {
+ if (this->activate () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "JAWS_Reaper::activate"),
+ -1);
+ this->waiting_ = 1;
+ }
+ }
+ return 0;
+}
+
+int
+JAWS_Reaper::svc (void)
+{
+ ACE_TRACE ("JAWS_Reaper::svc");
+ int result = this->concurrency_->thr_mgr ()->wait ();
+ JAWS_IO_Synch_Acceptor_Singleton::instance ()->close ();
+ JAWS_IO_Asynch_Acceptor_Singleton::instance ()->close ();
+ ACE_DEBUG ((LM_DEBUG, "(%t) Leaving REAPER\n"));
+ return result;
+}