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

Method SwapDaemonThread

adapter/micro_thread/micro_thread.cpp:898–910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

896}
897
898void MtFrame::SwapDaemonThread()
899{
900 MicroThread* thread = GetActiveThread();
901 MicroThread* daemon_thread = this->DaemonThread();
902 if(thread != daemon_thread){
903 if(thread->SaveContext() == 0){
904 this->InsertRunable(thread);
905 this->SetActiveThread(daemon_thread);
906 daemon_thread->SetState(MicroThread::RUNNING);
907 daemon_thread->RestoreContext();
908 }
909 }
910}
911
912bool MtFrame::KqueueSchedule(KqObjList* fdlist, KqueuerObj* fd, int timeout)
913{

Callers 1

mt_swap_threadFunction · 0.80

Calls 6

DaemonThreadMethod · 0.95
InsertRunableMethod · 0.95
SetActiveThreadMethod · 0.95
SaveContextMethod · 0.80
SetStateMethod · 0.80
RestoreContextMethod · 0.80

Tested by

no test coverage detected