void ProcessVariable::unsubscribe(Guard &guard) { guard.check(__FILE__, __LINE__, mutex); // See comments in stop(): this->id is already 0, state==INIT. if (isSubscribed(guard)) { #ifdef CHECK_EVID void *user = peek_evid_userptr(ev_id); LOG_ASSERT(user == this); #endif evid _ev_id = ev_id; ev_id = 0; GuardRelease release(__FILE__, __LINE__, guard); { Guard ctx_guard(__FILE__, __LINE__, ctx); LOG_ASSERT(ctx.isAttached(ctx_guard)); } try { ca_clear_subscription(_ev_id); } catch (std::exception &e) { LOG_MSG("ProcessVariable::unsubscribe(%s): %s\n", getName().c_str(), e.what()); } catch (...) { LOG_MSG("ProcessVariable::unsubscribe(%s): Unknown Exception\n", getName().c_str()); } } }
static void freepvInfo(pvInfo *i) { /* Remove all pending events in the Tcl event queue * pointing to this PV */ Tcl_DeleteEvents(PVeventDeleteProc, (ClientData)i); if (i->id) { if (i->monitorid) { ca_clear_subscription(i->monitorid); } ca_clear_channel(i->id); } ckfree(i->name); DecrIfNotNull(&i->connectprefix); DecrIfNotNull(&i->monitorprefix); ckfree(i); }
//______________________________________________________________________________ void beamPositionMonitorInterface::killCallBack( beamPositionMonitorStructs::monitorStruct * ms, beamPositionMonitorStructs::rawDataStruct * bpmdo )///, beamPositionMonitorStructs::bpmDataObject * bpmdo ) { int status = ca_clear_subscription( *ms -> EVID ); if( status == ECA_NORMAL) { // debugMessage( ms -> scopeObject, " monitoring = false "); isMonitoringMap[ ms -> bpmObject ] = false; // bpmdo -> isMonitoring = false; bpmdo -> appendingData = false; monitoringData = false; delete ms; } else { message("ERROR: in killCallBack: ca_clear_subscription failed for ", ms->bpmObject ); } }
/* * ca_clear_event () */ int epicsShareAPI ca_clear_event ( evid pMon ) { return ca_clear_subscription ( pMon ); }