[zion] Move channel to use the message queue.

This commit is contained in:
Drew Galbraith 2023-06-20 15:36:17 -07:00
parent fe1641ac38
commit d60b2bdc61
5 changed files with 27 additions and 89 deletions

View file

@ -20,7 +20,9 @@ z_err_t Port::Read(uint64_t* num_bytes, void* bytes, uint64_t* num_caps,
z_cap_t* caps) {
mutex_.Lock();
while (message_queue_.empty()) {
blocked_threads_.PushBack(gScheduler->CurrentThread());
auto thread = gScheduler->CurrentThread();
thread->SetState(Thread::BLOCKED);
blocked_threads_.PushBack(thread);
mutex_.Unlock();
gScheduler->Yield();
mutex_.Lock();