MCPcopy Create free account
hub / github.com/F-Stack/f-stack / aeCreateTimeEvent

Function aeCreateTimeEvent

app/redis-6.2.6/src/ae.c:211–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211long long aeCreateTimeEvent(aeEventLoop *eventLoop, long long milliseconds,
212 aeTimeProc *proc, void *clientData,
213 aeEventFinalizerProc *finalizerProc)
214{
215 long long id = eventLoop->timeEventNextId++;
216 aeTimeEvent *te;
217
218 te = zmalloc(sizeof(*te));
219 if (te == NULL) return AE_ERR;
220 te->id = id;
221 te->when = getMonotonicUs() + milliseconds * 1000;
222 te->timeProc = proc;
223 te->finalizerProc = finalizerProc;
224 te->clientData = clientData;
225 te->prev = NULL;
226 te->next = eventLoop->timeEventHead;
227 te->refcount = 0;
228 if (te->next)
229 te->next->prev = te;
230 eventLoop->timeEventHead = te;
231 return id;
232}
233
234int aeDeleteTimeEvent(aeEventLoop *eventLoop, long long id)
235{

Callers 5

performEvictionsFunction · 0.85
initServerFunction · 0.85
createBenchmarkThreadFunction · 0.85
mainFunction · 0.85
RM_CreateTimerFunction · 0.85

Calls 1

zmallocFunction · 0.85

Tested by

no test coverage detected