OpenDDS::DCPS::InstanceState::~InstanceState() { cancel_release(); #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE if (registered_) { OwnershipManager* om = reader_->ownership_manager(); if (om) om->remove_instance(this); } #endif }
void OpenDDS::DCPS::InstanceState::schedule_release() { DDS::DataReaderQos qos; this->reader_->get_qos(qos); DDS::Duration_t delay; switch (this->instance_state_) { case DDS::NOT_ALIVE_NO_WRITERS_INSTANCE_STATE: delay = qos.reader_data_lifecycle.autopurge_nowriter_samples_delay; break; case DDS::NOT_ALIVE_DISPOSED_INSTANCE_STATE: delay = qos.reader_data_lifecycle.autopurge_disposed_samples_delay; break; default: ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: InstanceState::schedule_release:") ACE_TEXT(" Unsupported instance state: %d!\n"), this->instance_state_)); return; } if (delay.sec != DDS::DURATION_INFINITE_SEC && delay.nanosec != DDS::DURATION_INFINITE_NSEC) { cancel_release(); ACE_Reactor_Timer_Interface* reactor = this->reader_->get_reactor(); this->release_timer_id_ = reactor->schedule_timer(this, 0, duration_to_time_value(delay)); if (this->release_timer_id_ == -1) { ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: InstanceState::schedule_release:") ACE_TEXT(" Unable to schedule timer!\n"))); } } else { // N.B. instance transitions are always followed by a non-valid // sample being queued to the ReceivedDataElementList; marking // the release as pending prevents this sample from being lost // if all samples have been already removed from the instance. schedule_pending(); } }
int multi_fork( int n, struct multi_fork_status *p, time_t stoptime, int line ) { int i, result; for( i=0; i<n; i++ ) { p[i].state = MULTI_FORK_STATE_CRADLE; } cancel_hold(); result = multi_start(n,p,stoptime,line); if(result==MULTI_FORK_SUCCESS) { result = multi_wait(n,p,stoptime,line,1); if(result!=MULTI_FORK_SUCCESS) { multi_kill(n,p,stoptime,line); } } cancel_release(); return result; }