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

Method schedule_i

dds/DCPS/SporadicTask.cpp:32–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32void SporadicTask::schedule_i(const MonotonicTimePoint& next_time,
33 const TimeDuration& delay)
34{
35 {
36 ACE_Guard<ACE_Thread_Mutex> guard(mutex_);
37 if (!desired_scheduled_ || next_time < desired_next_time_) {
38 desired_scheduled_ = true;
39 desired_next_time_ = next_time;
40 desired_delay_ = delay;
41 } else {
42 return;
43 }
44 }
45
46 const ReactorTask_rch reactor_task = reactor_task_.lock();
47 if (reactor_task) {
48 reactor_task->execute_or_enqueue(sporadic_command_);
49 } else if (log_level >= LogLevel::Error) {
50 ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: SporadicTask::schedule_i: "
51 "failed to receive ReactorTask handle\n"));
52 }
53}
54
55void SporadicTask::cancel()
56{

Callers

nothing calls this directly

Calls 2

execute_or_enqueueMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected