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

Method KqueueGetTimeout

adapter/micro_thread/micro_thread.cpp:770–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768}
769
770int MtFrame::KqueueGetTimeout()
771{
772 utime64_t now = GetLastClock();
773 MicroThread* thread = dynamic_cast<MicroThread*>(_sleeplist.HeapTop());
774 if (!thread)
775 {
776 return 10; //default 10ms epollwait
777 }
778 else if (thread->GetWakeupTime() < now)
779 {
780 return 0;
781 }
782 else
783 {
784 return (int)(thread->GetWakeupTime() - now);
785 }
786}
787
788inline void MtFrame::InsertSleep(MicroThread* thread)
789{

Callers

nothing calls this directly

Calls 2

HeapTopMethod · 0.80
GetWakeupTimeMethod · 0.80

Tested by

no test coverage detected