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

Method liveliness_lost_task

dds/DCPS/DataWriterImpl.cpp:2505–2542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2503}
2504
2505void
2506DataWriterImpl::liveliness_lost_task(const MonotonicTimePoint& now)
2507{
2508 ThreadStatusManager::Event ev(TheServiceParticipant->get_thread_status_manager());
2509
2510 ACE_Guard<ACE_Recursive_Thread_Mutex> guard(lock_);
2511
2512 const TimeDuration elapsed = now - last_liveliness_activity_time_;
2513
2514 if (elapsed < liveliness_lost_interval_) {
2515 // Reschedule.
2516 liveliness_lost_task_->schedule(liveliness_lost_interval_ - elapsed);
2517 return;
2518 }
2519
2520 const bool notify = !liveliness_lost_;
2521 liveliness_lost_task_->schedule(liveliness_lost_interval_);
2522 liveliness_lost_ = true;
2523
2524 if (notify) {
2525 ++liveliness_lost_status_.total_count;
2526 ++liveliness_lost_status_.total_count_change;
2527
2528 set_status_changed_flag(DDS::LIVELINESS_LOST_STATUS, true);
2529 notify_status_condition();
2530
2531 DDS::DataWriterListener_var listener = listener_for(DDS::LIVELINESS_LOST_STATUS);
2532
2533 if (!CORBA::is_nil(listener.in())) {
2534 {
2535 ACE_Reverse_Lock<ACE_Recursive_Thread_Mutex> rev_lock(lock_);
2536 ACE_Guard<ACE_Reverse_Lock<ACE_Recursive_Thread_Mutex> > rev_guard(rev_lock);
2537 listener->on_liveliness_lost(this, liveliness_lost_status_);
2538 }
2539 liveliness_lost_status_.total_count_change = 0;
2540 }
2541 }
2542}
2543
2544bool
2545DataWriterImpl::send_liveliness(const MonotonicTimePoint& now)

Callers

nothing calls this directly

Calls 3

scheduleMethod · 0.45
inMethod · 0.45
on_liveliness_lostMethod · 0.45

Tested by

no test coverage detected