mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
[kernel] Simplify mailbox interface to call/respond
The only real usage of mailbox was mailbox_call or mailbox_respond_receive. This change simplifies the interface to just these syscalls.
This commit is contained in:
@@ -45,18 +45,6 @@ mailbox::close()
|
||||
m_queue.clear();
|
||||
}
|
||||
|
||||
void
|
||||
mailbox::send(message *msg)
|
||||
{
|
||||
util::scoped_lock lock {m_message_lock};
|
||||
m_messages.push_back(msg);
|
||||
|
||||
thread *t = m_queue.pop_next();
|
||||
|
||||
lock.release();
|
||||
if (t) t->wake(has_message);
|
||||
}
|
||||
|
||||
bool
|
||||
mailbox::call(message *msg)
|
||||
{
|
||||
|
||||
@@ -39,11 +39,6 @@ public:
|
||||
/// Check if the mailbox has been closed
|
||||
inline bool closed() const { return m_closed; }
|
||||
|
||||
/// Send a message to a thread waiting to receive on this mailbox. If no threads
|
||||
/// are currently trying to receive, block the current thread.
|
||||
/// \arg msg The mailbox::message data structure to send
|
||||
void send(message *msg);
|
||||
|
||||
/// Send a message to a thread waiting to receive on this mailbox, and block the
|
||||
/// current thread awaiting a response. The response will be placed in the message
|
||||
/// object provided.
|
||||
|
||||
Reference in New Issue
Block a user