| 517 | } |
| 518 | |
| 519 | extern "C" int aeDeleteTimeEvent(aeEventLoop *eventLoop, long long id) |
| 520 | { |
| 521 | serverAssert(g_eventLoopThisThread == NULL || g_eventLoopThisThread == eventLoop); |
| 522 | aeTimeEvent *te = eventLoop->timeEventHead; |
| 523 | while(te) { |
| 524 | if (te->id == id) { |
| 525 | te->id = AE_DELETED_EVENT_ID; |
| 526 | return AE_OK; |
| 527 | } |
| 528 | te = te->next; |
| 529 | } |
| 530 | return AE_ERR; /* NO event with the specified ID found */ |
| 531 | } |
| 532 | |
| 533 | /* How many microseconds until the first timer should fire. |
| 534 | * If there are no timers, -1 is returned. |