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

Method KqueueCtlDel

adapter/micro_thread/kqueue_proxy.cpp:525–551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

523}
524
525int KqueuerObj::KqueueCtlDel(void* args)
526{
527 MtFrame* frame = MtFrame::Instance();
528 KqFdRef* fd_ref = (KqFdRef*)args;
529 kqueue_assert(fd_ref != NULL);
530
531 int osfd = this->GetOsfd();
532 int events = this->GetEvents();
533
534 KqueuerObj* old_obj = fd_ref->GetNotifyObj();
535 if (old_obj != this)
536 {
537 MTLOG_ERROR("kqfd ref conflict, fd: %d, old: %p, now: %p", osfd, old_obj, this);
538 return -1;
539 }
540 fd_ref->SetNotifyObj(NULL);
541
542 if (!frame->KqueueCtrlDelRef(osfd, events, false))
543 {
544 MTLOG_ERROR("kqfd ref del failed, log");
545 fd_ref->SetNotifyObj(old_obj);
546 return -2;
547 }
548
549 return 0;
550
551}
552

Callers 1

KqueueDelObjMethod · 0.45

Calls 5

GetOsfdMethod · 0.95
GetEventsMethod · 0.95
GetNotifyObjMethod · 0.80
SetNotifyObjMethod · 0.80
KqueueCtrlDelRefMethod · 0.80

Tested by

no test coverage detected