Dv::Thread::MailBox< M > Class Template Reference
A mailbox that supports thread-safe addition and retrieval of messages.
More...
#include <mailbox.h>
List of all members.
Detailed Description
template<typename M>
class Dv::Thread::MailBox< M >
A mailbox that supports thread-safe addition and retrieval of messages.
Member Enumeration Documentation
Constructor & Destructor Documentation
Constructor.
- Parameters:
-
| name | of mailbox, used for tracing. |
| max_capacity | an attempt to put more than max_capacity messages will cause MailBox::put to throw an exception. If 0, capacity is unlimited. |
Member Function Documentation
- Returns:
- max capacity of this mailbox
Get a message from a mailbox.
This function will block until a message is available.
- Parameters:
-
| millisec_to_wait | time to wait for message if none are available; if the time has passed and no messages are available, a std::runtime_error is thrown. |
- Exceptions:
-
| std::runtime_error | if no messages are available after waiting millisec_to_wait millisecs |
Referenced by Dv::Thread::Actor< Handler >::main().
- Returns:
- number of pending messages.
Member Data Documentation
The documentation for this class was generated from the following file: