MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / attach_condition

Method attach_condition

dds/DCPS/WaitSet.cpp:38–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36namespace DDS {
37
38DDS::ReturnCode_t WaitSet::attach_condition(Condition_ptr cond)
39{
40 using OpenDDS::DCPS::ConditionImpl;
41 Condition_var condv(Condition::_duplicate(cond));
42
43 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, g, lock_,
44 RETCODE_OUT_OF_RESOURCES);
45 ConditionImpl* ci = dynamic_cast<ConditionImpl*>(cond);
46
47 if (!ci) return RETCODE_BAD_PARAMETER;
48
49 ReturnCode_t ret = ci->attach_to_ws(this);
50
51 if (ret == RETCODE_OK) {
52 attached_conditions_.insert(condv);
53
54 if (condv->get_trigger_value()) signal(condv.in());
55
56 return RETCODE_OK;
57
58 } else if (ret == RETCODE_PRECONDITION_NOT_MET) {
59 // RETCODE_PRECONDITION_NOT_MET means it was already in the set
60 return RETCODE_OK;
61 }
62
63 return ret;
64}
65
66ReturnCode_t WaitSet::detach_condition(Condition_ptr cond)
67{

Callers 15

mainMethod · 0.95
waitForSampleMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
callMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
ACE_TMAINFunction · 0.80
ACE_TMAINFunction · 0.80
ACE_TMAINFunction · 0.80

Calls 4

attach_to_wsMethod · 0.80
insertMethod · 0.45
get_trigger_valueMethod · 0.45
inMethod · 0.45

Tested by 15

mainMethod · 0.76
waitForSampleMethod · 0.76
mainMethod · 0.76
mainMethod · 0.76
mainMethod · 0.76
mainMethod · 0.76
callMethod · 0.76
mainMethod · 0.76
mainMethod · 0.76
ACE_TMAINFunction · 0.64
ACE_TMAINFunction · 0.64
ACE_TMAINFunction · 0.64