[tests] Get mailbox test running again

This commit fixes the mailbox tests in test_runner, which broke when
mailbox was simplified to just use call and respond. It also fixes a
bug the tests uncovered: if the mailbox is closed while a caller is in
the reply map (ie, when its call data has been passed on to a thread
calling respond, but has yet to be responded to itself), that caller is
never awoken.
This commit is contained in:
Justin C. Miller
2023-02-08 23:16:22 -08:00
parent 4125175870
commit 094b54d728
3 changed files with 42 additions and 34 deletions

View File

@@ -26,6 +26,10 @@ mailbox::close()
m_callers.clear(j6_status_closed);
m_responders.clear(j6_status_closed);
util::scoped_lock lock {m_reply_lock};
for (auto &waiting : m_reply_map)
waiting.thread->wake(j6_status_closed);
}
j6_status_t