OpenDDS  Snapshot(2023/04/28-20:55)
ConditionImpl.cpp
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 "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/
9 #include "ConditionImpl.h"
10 
12 
13 namespace OpenDDS {
14 namespace DCPS {
15 
17 {
18  if (DCPS_debug_level > 9) {
20  ACE_TEXT("(%P|%t) ConditionImpl::signal_all()\n")));
21  }
22 
23  if (!get_trigger_value()) return;
24 
25  WaitSetSet local_ws;
26  {
28  local_ws = waitsets_;
29  }
30 
31  if (DCPS_debug_level > 9) {
33  ACE_TEXT("(%P|%t) ConditionImpl::signal_all() - ")
34  ACE_TEXT("number of sets: %B\n"),
35  local_ws.size()));
36  }
37 
38  for (WaitSetSet::iterator it = local_ws.begin(), end = local_ws.end();
39  it != end; ++it) {
40  RcHandle<DDS::WaitSet> ws ((*it).lock());
41  if (ws)
42  ws->signal(this);
43  }
44 }
45 
47 {
50  return waitsets_.insert(OpenDDS::DCPS::WeakRcHandle<DDS::WaitSet>(*ws)).second
52 }
53 
55 {
60 }
61 
62 } // namespace DCPS
63 } // namespace OpenDDS
64 
#define ACE_DEBUG(X)
#define ACE_GUARD(MUTEX, OBJ, LOCK)
const ReturnCode_t RETCODE_PRECONDITION_NOT_MET
ACE_Recursive_Thread_Mutex lock_
Definition: ConditionImpl.h:42
LM_DEBUG
boolean get_trigger_value()
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_OUT_OF_RESOURCES
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DDS::ReturnCode_t detach_from_ws(DDS::WaitSet_ptr ws)
DDS::ReturnCode_t attach_to_ws(DDS::WaitSet_ptr ws)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
const ReturnCode_t RETCODE_OK
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28