Mark unblocked threads as runnable before enqueueing them
This commit is contained in:
parent
ffa2d97a64
commit
71e51730b7
2 changed files with 6 additions and 2 deletions
|
|
@ -82,7 +82,9 @@ z_err_t Channel::EnqueueMessage(const ZMessage& msg) {
|
|||
pending_messages_.PushBack(message);
|
||||
|
||||
if (blocked_threads_.size() > 0) {
|
||||
gScheduler->Enqueue(blocked_threads_.PopFront());
|
||||
auto thread = blocked_threads_.PopFront();
|
||||
thread->SetState(Thread::RUNNABLE);
|
||||
gScheduler->Enqueue(thread);
|
||||
}
|
||||
return Z_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue