Skip to content

Commit

Permalink
Fix receive
Browse files Browse the repository at this point in the history
  • Loading branch information
g41797 committed Sep 19, 2024
1 parent e2c3dba commit d6068f8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/mailbox.zig
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ pub fn MailBox(comptime T: type) type {
mbox.mutex.lock();
defer mbox.mutex.unlock();

if (mbox.closed) {
return error.Closed;
}

while (mbox.len == 0) {

if (mbox.closed) {
return error.Closed;
}

const elapsed = timeout_timer.read();
if (elapsed > timeout_ns)
return error.Timeout;
Expand Down

0 comments on commit d6068f8

Please sign in to comment.