ThreadSynch.inl

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #include "ThreadSynchResource.h"
00009 #include "EntryExit.h"
00010 
00011 /// Note that we allow the ThreadSynchResource pointer to be NULL to
00012 /// support the NullSynch case.
00013 ACE_INLINE
00014 OpenDDS::DCPS::ThreadSynch::ThreadSynch(ThreadSynchResource* resource)
00015   : resource_(resource)
00016 {
00017   DBG_ENTRY_LVL("ThreadSynch","ThreadSynch",6);
00018 }
00019 
00020 ACE_INLINE
00021 OpenDDS::DCPS::WeakRcHandle<OpenDDS::DCPS::ThreadSynchWorker>
00022 OpenDDS::DCPS::ThreadSynch::worker()
00023 {
00024   return worker_;
00025 }
00026 
00027 ACE_INLINE int
00028 OpenDDS::DCPS::ThreadSynch::register_worker(ThreadSynchWorker& worker)
00029 {
00030   DBG_ENTRY_LVL("ThreadSynch","register_worker",6);
00031   this->worker_ = worker;
00032   if (resource_)
00033     resource_->set_handle(worker.get_handle());
00034   return this->register_worker_i();
00035 }
00036 
00037 ACE_INLINE void
00038 OpenDDS::DCPS::ThreadSynch::unregister_worker()
00039 {
00040   DBG_ENTRY_LVL("ThreadSynch","unregister_worker",6);
00041   this->unregister_worker_i();
00042 }
00043 
00044 
00045 ACE_INLINE int
00046 OpenDDS::DCPS::ThreadSynch::wait_on_clogged_resource()
00047 {
00048   DBG_ENTRY_LVL("ThreadSynch","wait_on_clogged_resource",6);
00049 
00050   int result = -1;
00051 
00052   if (this->resource_) {
00053     result = this->resource_->wait_to_unclog();
00054 
00055   } else {
00056     ACE_ERROR((LM_ERROR,
00057                "(%P|%t) ERROR: ThreadSynch cannot wait on a NULL clogged resource.\n"));
00058   }
00059 
00060   return result;
00061 }
00062 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1