! cancel a previously scheduled event. @param eventSequence The numeric ID of a previously scheduled event. @return No return value. @sa getEventTimeLeft, getScheduleDuration, getTimeSinceStart, isEventPending, schedule, obj.schedule */
| 131 | @sa getEventTimeLeft, getScheduleDuration, getTimeSinceStart, isEventPending, schedule, obj.schedule |
| 132 | */ |
| 133 | void cancelEvent(U32 eventSequence) |
| 134 | { |
| 135 | Mutex::lockMutex(gEventQueueMutex); |
| 136 | |
| 137 | SimEvent **walk = &gEventQueue; |
| 138 | SimEvent *current; |
| 139 | |
| 140 | while((current = *walk) != NULL) |
| 141 | { |
| 142 | if(current->sequenceCount == eventSequence) |
| 143 | { |
| 144 | *walk = current->nextEvent; |
| 145 | delete current; |
| 146 | Mutex::unlockMutex(gEventQueueMutex); |
| 147 | return; |
| 148 | } |
| 149 | else |
| 150 | walk = &(current->nextEvent); |
| 151 | } |
| 152 | |
| 153 | Mutex::unlockMutex(gEventQueueMutex); |
| 154 | } |
| 155 | |
| 156 | void cancelPendingEvents(SimObject *obj) |
| 157 | { |
no outgoing calls
no test coverage detected