summaryrefslogtreecommitdiff
path: root/trunk/ACE/apps/JAWS3/jaws3/Concurrency_T.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/ACE/apps/JAWS3/jaws3/Concurrency_T.cpp')
-rw-r--r--trunk/ACE/apps/JAWS3/jaws3/Concurrency_T.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/trunk/ACE/apps/JAWS3/jaws3/Concurrency_T.cpp b/trunk/ACE/apps/JAWS3/jaws3/Concurrency_T.cpp
new file mode 100644
index 00000000000..ea86da1c989
--- /dev/null
+++ b/trunk/ACE/apps/JAWS3/jaws3/Concurrency_T.cpp
@@ -0,0 +1,47 @@
+// $Id$
+
+#include "ace/Message_Block.h"
+#include "ace/Singleton.h"
+#include "ace/Synch_Traits.h"
+#include "ace/Null_Mutex.h"
+
+#include "jaws3/Concurrency_T.h"
+
+typedef ACE_Singleton<ACE_Message_Block, ACE_SYNCH_NULL_MUTEX>
+ JAWS_Empty_Message_Block;
+
+
+template <class CONCURRENCY_IMPL>
+JAWS_Concurrency_Bridge<CONCURRENCY_IMPL>
+::JAWS_Concurrency_Bridge (CONCURRENCY_IMPL *impl)
+ : impl_ (impl)
+{
+ if (this->impl_ == 0)
+ this->impl_ = CONCURRENCY_IMPL::instance ();
+}
+
+
+template <class CONCURRENCY_IMPL> int
+JAWS_Concurrency_Bridge<CONCURRENCY_IMPL>::putq (JAWS_Protocol_Handler *ph)
+{
+ return this->impl_->putq (ph);
+}
+
+
+template <class CONCURRENCY_IMPL> int
+JAWS_Concurrency_Bridge<CONCURRENCY_IMPL>::getq (JAWS_Protocol_Handler *&ph)
+{
+ return this->impl_->getq (ph);
+}
+
+
+template <class CONCURRENCY_IMPL> void
+JAWS_Concurrency_Bridge<CONCURRENCY_IMPL>::shutdown (void)
+{
+ ACE_Message_Block *empty_mb = JAWS_Empty_Message_Block::instance ();
+ JAWS_CONCURRENCY_TASK *task;
+
+ task = this->impl_;
+ task->putq (empty_mb);
+ task->wait ();
+}