Zth (libzth)
zth::Waiter Class Reference

A single fiber per Worker that manages sleeping and blocked fibers. More...

#include <waiter.h>

Inheritance diagram for zth::Waiter:
zth::Runnable

Public Member Functions

 Waiter (Worker &worker)
 
virtual ~Waiter () override
 
void wait (TimedWaitable &w)
 
void scheduleTask (TimedWaitable &w)
 
void unscheduleTask (TimedWaitable &w)
 
void wakeup (TimedWaitable &w)
 
PollerServerBasepoller ()
 
void setPoller (PollerServerBase *p=nullptr)
 
void wakeup ()
 
- Public Member Functions inherited from zth::Runnable
virtual ~Runnable ()=default
 
int run ()
 
Fiberfiber () const noexcept
 
 operator Fiber & () const noexcept
 
char const * id_str () const
 

Protected Member Functions

bool polling () const
 
virtual int fiberHook (Fiber &f) override
 
virtual void entry () override
 
- Protected Member Functions inherited from zth::Runnable
constexpr Runnable () noexcept
 
virtual void cleanup ()
 

Detailed Description

A single fiber per Worker that manages sleeping and blocked fibers.

Definition at line 197 of file waiter.h.

Constructor & Destructor Documentation

◆ Waiter()

zth::Waiter::Waiter ( Worker worker)
explicit

Definition at line 17 of file waiter.cpp.

◆ ~Waiter()

zth::Waiter::~Waiter ( )
overridevirtual

Definition at line 23 of file waiter.cpp.

Member Function Documentation

◆ entry()

void zth::Waiter::entry ( )
overrideprotectedvirtual

Implements zth::Runnable.

Definition at line 151 of file waiter.cpp.

◆ fiberHook()

virtual int zth::Waiter::fiberHook ( Fiber f)
inlineoverrideprotectedvirtual

Reimplemented from zth::Runnable.

Definition at line 215 of file waiter.h.

◆ poller()

PollerServerBase & zth::Waiter::poller ( )

Definition at line 98 of file waiter.cpp.

◆ polling()

bool zth::Waiter::polling ( ) const
protected

Definition at line 109 of file waiter.cpp.

◆ scheduleTask()

void zth::Waiter::scheduleTask ( TimedWaitable w)

Definition at line 62 of file waiter.cpp.

◆ setPoller()

void zth::Waiter::setPoller ( PollerServerBase p = nullptr)

Definition at line 128 of file waiter.cpp.

◆ unscheduleTask()

void zth::Waiter::unscheduleTask ( TimedWaitable w)

Definition at line 74 of file waiter.cpp.

◆ wait()

void zth::Waiter::wait ( TimedWaitable w)

Definition at line 34 of file waiter.cpp.

◆ wakeup() [1/2]

void zth::Waiter::wakeup ( )

Definition at line 122 of file waiter.cpp.

◆ wakeup() [2/2]

void zth::Waiter::wakeup ( TimedWaitable w)

Definition at line 85 of file waiter.cpp.


The documentation for this class was generated from the following files: