OpenDDS  Snapshot(2023/04/28-20:55)
ThreadSynchResource.inl
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #include "EntryExit.h"
9 #include "ace/ACE.h"
10 
13  : handle_(ACE_INVALID_HANDLE)
14  , timeout_(0)
15 {
16  DBG_ENTRY_LVL("ThreadSynchResource","ThreadSynchResource",6);
17 }
18 
19 ACE_INLINE int
21 {
22  DBG_ENTRY_LVL("ThreadSynchResource","wait_to_unclog",6);
23 
24  if (ACE::handle_write_ready(handle_, timeout_ ? &timeout_->value() : 0) == -1) {
25  if (errno == ETIME) {
26  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: handle_write_ready timed out\n"));
28 
29  } else {
31  "(%P|%t) ERROR: ACE::handle_write_ready return -1 while waiting "
32  " to unclog. %p\n", ACE_TEXT("handle_write_ready")));
33  }
34 
35  return -1;
36  }
37 
38  return 0;
39 }
40 
41 ACE_INLINE void
43 {
44  handle_ = handle;
45 }
#define ACE_ERROR(X)
virtual void notify_lost_on_backpressure_timeout()=0
const ACE_Time_Value & value() const
#define ETIME
ACE_TEXT("TCP_Factory")
int handle_write_ready(ACE_HANDLE handle, const ACE_Time_Value *timeout)
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68
#define ACE_INLINE
LM_ERROR