| 874 | } |
| 875 | |
| 876 | void 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 | |
| 898 | void MtFrame::SwapDaemonThread() |
| 899 | { |
nothing calls this directly
no test coverage detected