MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / aeDeleteFileEvent

Function aeDeleteFileEvent

src/ae.cpp:462–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462extern "C" void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask)
463{
464 serverAssert(g_eventLoopThisThread == NULL || g_eventLoopThisThread == eventLoop);
465 if (fd >= eventLoop->setsize) return;
466 aeFileEvent *fe = &eventLoop->events[fd];
467 if (fe->mask == AE_NONE) return;
468
469 /* We want to always remove AE_BARRIER if set when AE_WRITABLE
470 * is removed. */
471 if (mask & AE_WRITABLE) mask |= AE_BARRIER;
472
473 if (mask & AE_WRITABLE) mask |= AE_WRITE_THREADSAFE;
474 if (mask & AE_READABLE) mask |= AE_READ_THREADSAFE;
475
476 aeApiDelEvent(eventLoop, fd, mask);
477 fe->mask = fe->mask & (~mask);
478 if (fd == eventLoop->maxfd && fe->mask == AE_NONE) {
479 /* Update the max fd */
480 int j;
481
482 for (j = eventLoop->maxfd-1; j >= 0; j--)
483 if (eventLoop->events[j].mask != AE_NONE) break;
484 eventLoop->maxfd = j;
485 }
486}
487
488extern "C" int aeGetFileEvents(aeEventLoop *eventLoop, int fd) {
489 if (fd >= eventLoop->setsize) return 0;

Callers 15

connSocketCloseFunction · 0.85
connSocketSetReadHandlerFunction · 0.85
connSocketEventHandlerFunction · 0.85
aeProcessCmdFunction · 0.85
aeDeleteFileEventAsyncFunction · 0.85
freeClientFunction · 0.85
resetClientFunction · 0.85
writeHandlerFunction · 0.85
freeClientFunction · 0.85
resetClientFunction · 0.85

Calls 1

aeApiDelEventFunction · 0.70

Tested by

no test coverage detected