|
Zth (libzth)
|
Fiber-aware mailbox. More...
#include <sync.h>
Public Types | |
| typedef T | type |
| typedef void * | assigned_type |
Public Types inherited from zth::Synchronizer< 2 > | |
| typedef SynchronizerBase | base |
Public Types inherited from zth::UniqueID< SynchronizerBase > | |
| typedef NamedUniqueID | base |
Public Member Functions | |
| Mailbox (cow_string const &name="Mailbox") | |
| Mailbox (cow_string &&name) | |
| virtual | ~Mailbox () noexcept override=default |
| bool | valid () const noexcept |
| operator bool () const noexcept | |
| bool | can_put () const noexcept |
| bool | can_take () const noexcept |
| void | wait () |
| void | wait_empty () |
| void | put (type const &value) |
| Mailbox & | operator= (type const &value) |
| void | put (type &&value) |
| Mailbox & | operator= (type &&value) |
| type | take () |
Public Member Functions inherited from zth::Synchronizer< 2 > | |
| Synchronizer ()=default | |
| Synchronizer (cow_string const &name) | |
| Synchronizer (cow_string &&name) | |
| virtual | ~Synchronizer () noexcept override |
Public Member Functions inherited from zth::SynchronizerBase | |
| virtual | ~SynchronizerBase () noexcept override |
Public Member Functions inherited from zth::RefCounted | |
| RefCounted () noexcept | |
| virtual | ~RefCounted () noexcept |
| void | used () noexcept |
| bool | unused () noexcept |
| size_t | refs () const noexcept |
Public Member Functions inherited from zth::UniqueID< SynchronizerBase > | |
| UniqueID (UniqueID const &)=delete | |
| UniqueID (UniqueID &&u) noexcept | |
| UniqueID (string const &name) | |
| UniqueID (string &&name) | |
| UniqueID (char const *name=nullptr) | |
| UniqueID & | operator= (UniqueID const &)=delete |
| UniqueID & | operator= (UniqueID &&u) noexcept |
| virtual | ~UniqueID () noexcept override=default |
| void const * | normptr () const noexcept |
| uint64_t | id () const noexcept |
Public Member Functions inherited from zth::NamedUniqueID< Named > | |
| virtual | ~NamedUniqueID () noexcept override=default |
| string const & | name () const noexcept |
| void | setName (string const &name) |
| void | setName (char const *name) |
| void | setName (string &&name) |
| virtual char const * | id_str () const noexcept override |
Protected Types | |
| enum | { Queue_Put = 0 , Queue_Take = 1 } |
Protected Types inherited from zth::Synchronizer< 2 > | |
| typedef base::queue_type | queue_type |
Protected Types inherited from zth::SynchronizerBase | |
| typedef List | queue_type |
Protected Member Functions | |
| bool | valid (assigned_type assigned) const noexcept |
| virtual void | wait (assigned_type assigned) |
| type | take (assigned_type assigned) |
| virtual void | wakeup (Listable &item, queue_type::user_type user, bool prio, size_t q) noexcept final |
| virtual assigned_type | wakeup (Listable &item, queue_type::user_type user, bool prio) noexcept |
Protected Member Functions inherited from zth::Synchronizer< 2 > | |
| virtual queue_type & | queue (size_t q) final |
Protected Member Functions inherited from zth::SynchronizerBase | |
| SynchronizerBase (cow_string const &name="Synchronizer") | |
| SynchronizerBase (cow_string &&name) | |
| queue_type::iterator | enqueue (Listable &item, size_t q=0) noexcept |
| void | block (size_t q=0) |
| bool | unblock (Fiber &f, size_t q=0, bool prio=false) noexcept |
| Unblock the specific fiber. | |
| Listable * | unblockFirst (size_t q=0, bool prio=false) noexcept |
| bool | unblockAll (size_t q=0, bool prio=false) noexcept |
| bool | blockUntil (Timestamp const &timeout, Timestamp const &now=Timestamp::now(), size_t q=0) |
| Block, with timeout. | |
| bool | blockFor (TimeInterval const &timeout, Timestamp const &now=Timestamp::now(), size_t q=0) |
| Block, with timeout. | |
Protected Member Functions inherited from zth::RefCounted | |
| virtual void | cleanup () noexcept |
Protected Member Functions inherited from zth::UniqueID< SynchronizerBase > | |
| virtual uint64_t | id_ () const noexcept final |
Protected Member Functions inherited from zth::NamedUniqueID< Named > | |
| NamedUniqueID (char const *name=nullptr) | |
| NamedUniqueID (string const &name) | |
| NamedUniqueID (string &&name) | |
Protected Member Functions inherited from zth::UniqueIDBase | |
| virtual | ~UniqueIDBase () noexcept=default |
Additional Inherited Members | |
Static Public Member Functions inherited from zth::UniqueID< SynchronizerBase > | |
| static uint64_t | getID () noexcept |
Fiber-aware mailbox.
| typedef void* zth::Mailbox< T >::assigned_type |
| typedef T zth::Mailbox< T >::type |
|
protected |
|
inlineexplicit |
|
inlineexplicit |
|
overridevirtualdefaultnoexcept |
Reimplemented in zth::coro::Mailbox< T >.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inlinenoexcept |
|
inlineprotectednoexcept |
|
inline |
|
inlineprotectedvirtual |
Reimplemented in zth::coro::Mailbox< T >, and zth::coro::Mailbox< T >.
|
inline |
|
inlineprotectedvirtualnoexcept |
|
inlinefinalprotectedvirtualnoexcept |
Reimplemented from zth::SynchronizerBase.