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

Method NotifyThread

adapter/micro_thread/micro_thread.cpp:876–896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

874}
875
876void MtFrame::NotifyThread(MicroThread* thread)
877{
878 if(thread == NULL){
879 return;
880 }
881 MicroThread* cur_thread = GetActiveThread();
882 if (thread->HasFlag(MicroThread::IO_LIST))
883 {
884 this->RemoveIoWait(thread);
885 if(cur_thread == this->DaemonThread()){
886 // ���ﲻֱ���еĻ�,���Dz���ʱ,�ᵼ��Ŀ���̵߳ȴ�����ʱ
887 if(cur_thread->SaveContext() == 0){
888 this->SetActiveThread(thread);
889 thread->SetState(MicroThread::RUNNING);
890 thread->RestoreContext();
891 }
892 }else{
893 this->InsertRunable(thread);
894 }
895 }
896}
897
898void MtFrame::SwapDaemonThread()
899{

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected