Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
Realm::Doorbell Class Reference

#include <mutex.h>

Collaboration diagram for Realm::Doorbell:

Public Member Functions

void set_sleep_timeout (long long timeout_in_ns)
 
void prepare ()
 
void cancel ()
 
bool satisfied ()
 
uint32_t wait ()
 
bool is_sleeping () const
 
void notify (uint32_t data)
 
void prewake ()
 
void cancel_prewake ()
 

Static Public Member Functions

static Doorbellget_thread_doorbell ()
 

Static Public Attributes

static const long long DOORBELL_SLEEP_IMMEDIATE = 0
 
static const long long DOORBELL_SLEEP_NEVER = -1
 
static const long long DOORBELL_SLEEP_DEFAULT = 10000
 

Protected Member Functions

 Doorbell ()
 
 ~Doorbell ()
 
uint32_t wait_slow ()
 
void notify_slow ()
 
void prewake_slow ()
 

Protected Attributes

atomic< uint32_t > state
 
long long sleep_timeout
 
long long next_sleep_time
 
uintptr_t owner_tid
 
Doorbellnext_doorbell
 

Static Protected Attributes

static const uint32_t STATE_IDLE = 0
 
static const uint32_t STATE_PENDING_AWAKE = 2
 
static const uint32_t STATE_PENDING_ASLEEP = 4
 
static const uint32_t STATE_PENDING_PREWAKE = 6
 
static const uint32_t STATE_SATISFIED_BIT = 1
 
static const unsigned STATE_SATISFIED_VAL_SHIFT = 1
 

Friends

class DoorbellList
 

Constructor & Destructor Documentation

◆ Doorbell()

Realm::Doorbell::Doorbell ( )
protected

◆ ~Doorbell()

Realm::Doorbell::~Doorbell ( )
protected

Member Function Documentation

◆ cancel()

void Realm::Doorbell::cancel ( )

◆ cancel_prewake()

void Realm::Doorbell::cancel_prewake ( )

◆ get_thread_doorbell()

static Doorbell * Realm::Doorbell::get_thread_doorbell ( )
static

◆ is_sleeping()

bool Realm::Doorbell::is_sleeping ( ) const

◆ notify()

void Realm::Doorbell::notify ( uint32_t  data)

◆ notify_slow()

void Realm::Doorbell::notify_slow ( )
protected

◆ prepare()

void Realm::Doorbell::prepare ( )

◆ prewake()

void Realm::Doorbell::prewake ( )

◆ prewake_slow()

void Realm::Doorbell::prewake_slow ( )
protected

◆ satisfied()

bool Realm::Doorbell::satisfied ( )

◆ set_sleep_timeout()

void Realm::Doorbell::set_sleep_timeout ( long long  timeout_in_ns)

◆ wait()

uint32_t Realm::Doorbell::wait ( )

◆ wait_slow()

uint32_t Realm::Doorbell::wait_slow ( )
protected

Friends And Related Symbol Documentation

◆ DoorbellList

friend class DoorbellList
friend

Member Data Documentation

◆ DOORBELL_SLEEP_DEFAULT

const long long Realm::Doorbell::DOORBELL_SLEEP_DEFAULT = 10000
static

◆ DOORBELL_SLEEP_IMMEDIATE

const long long Realm::Doorbell::DOORBELL_SLEEP_IMMEDIATE = 0
static

◆ DOORBELL_SLEEP_NEVER

const long long Realm::Doorbell::DOORBELL_SLEEP_NEVER = -1
static

◆ next_doorbell

Doorbell* Realm::Doorbell::next_doorbell
protected

◆ next_sleep_time

long long Realm::Doorbell::next_sleep_time
protected

◆ owner_tid

uintptr_t Realm::Doorbell::owner_tid
protected

◆ sleep_timeout

long long Realm::Doorbell::sleep_timeout
protected

◆ state

atomic<uint32_t> Realm::Doorbell::state
protected

◆ STATE_IDLE

const uint32_t Realm::Doorbell::STATE_IDLE = 0
staticprotected

◆ STATE_PENDING_ASLEEP

const uint32_t Realm::Doorbell::STATE_PENDING_ASLEEP = 4
staticprotected

◆ STATE_PENDING_AWAKE

const uint32_t Realm::Doorbell::STATE_PENDING_AWAKE = 2
staticprotected

◆ STATE_PENDING_PREWAKE

const uint32_t Realm::Doorbell::STATE_PENDING_PREWAKE = 6
staticprotected

◆ STATE_SATISFIED_BIT

const uint32_t Realm::Doorbell::STATE_SATISFIED_BIT = 1
staticprotected

◆ STATE_SATISFIED_VAL_SHIFT

const unsigned Realm::Doorbell::STATE_SATISFIED_VAL_SHIFT = 1
staticprotected

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