mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user