static void freeEvent(Event ev) { unlinkEvent(ev); if ( ev->goal ) PL_erase(ev->goal); ev->magic = 0; free(ev); }
static int uninstallEvent(Event ev) { LOCK(); if ( TheSchedule()->scheduled == ev ) ev->flags |= EV_DONE; unlinkEvent(ev); ev->flags &= ~(EV_FIRED|EV_DONE); UNLOCK(); pthread_cond_signal(&cond); return TRUE; }
void MidiEvent::linkEvent(MidiEvent* mev) { if (mev->m_eventlink != NULL) { // unlink other event if it is linked to something else; mev->unlinkEvent(); } // if this is already linked to something else, then unlink: if (m_eventlink != NULL) { m_eventlink->unlinkEvent(); } unlinkEvent(); mev->m_eventlink = this; m_eventlink = mev; }