ThreadSynchResource.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 "EntryExit.h"
00009 #include "ace/ACE.h"
00010 
00011 ACE_INLINE
00012 OpenDDS::DCPS::ThreadSynchResource::ThreadSynchResource(ACE_HANDLE handle)
00013   : handle_(handle),
00014     timeout_(0)
00015 {
00016   DBG_ENTRY_LVL("ThreadSynchResource","ThreadSynchResource",6);
00017 }
00018 
00019 ACE_INLINE int
00020 OpenDDS::DCPS::ThreadSynchResource::wait_to_unclog()
00021 {
00022   DBG_ENTRY_LVL("ThreadSynchResource","wait_to_unclog",6);
00023 
00024   if (ACE::handle_write_ready(this->handle_, this->timeout_) == -1) {
00025     if (errno == ETIME) {
00026       ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: handle_write_ready timed out\n"));
00027       this->notify_lost_on_backpressure_timeout();
00028 
00029     } else {
00030       ACE_ERROR((LM_ERROR,
00031                  "(%P|%t) ERROR: ACE::handle_write_ready return -1 while waiting "
00032                  " to unclog. %p \n", ACE_TEXT("handle_write_ready")));
00033     }
00034 
00035     return -1;
00036   }
00037 
00038   return 0;
00039 }

Generated on Fri Feb 12 20:05:28 2016 for OpenDDS by  doxygen 1.4.7