BIRNET Interface Reference

/opt/src/beast/birnet/birnetthread.hh

SYNOPSIS

DESCRIPTION

Birnet::Atomic::RingBuffer

/opt/src/beast/birnet/birnetthread.hh:216
class Birnet::Atomic::RingBuffer
{
  const uint m_size;
  T         *m_buffer;
  uint       m_wmark;
  uint       m_rmark;
    BIRNET_PRIVATE_CLASS_COPY  ();
    RingBuffer  (bsize);
    ~RingBuffer  ();
  uint  n_writable  ();
  uint  write  (length, data, partial);
  uint  n_readable  ();
  uint  read  (length, data, partial);
};

   

  RingBuffer 
(uint bsize);

  ~RingBuffer 
();

uint  n_writable 
();

uint  write 
(uint     length,
 const T *data,
 bool     partial);

uint  n_readable 
();

uint  read 
(uint length,
 T   *data,
 bool partial);

Birnet::AutoLocker

/opt/src/beast/birnet/birnetthread.hh:171
class Birnet::AutoLocker
{
  void                  *pointers [sizeof(LockerImpl< Mutex >)/sizeof(void*)];
  char                   chars    [sizeof(LockerImpl< Mutex >)];
  Birnet::AutoLocker::$0 space;
  uint                   lcount;
  const Locker*  locker  ();
    BIRNET_PRIVATE_CLASS_COPY  ();
  void  initlock  ();
  void  assert_impl  (lockable);
    ~AutoLocker  ();
    AutoLocker  (lockable);
    AutoLocker  (lockable);
  void  relock  ();
  void  unlock  ();
};
The AutoLocker class locks mutex like objects on construction, and automatically unlocks on destruction. So putting an AutoLocker object on the stack conveniently ensures that a mutex will be automatically locked and properly unlocked when the function returns or throws an exception. Objects intended to be used by an AutoLocker need to provide the public methods lock() and unlock().
   
const Locker*  locker 
();


void  initlock 
();

void  assert_impl 
(Lockable  &lockable);

  ~AutoLocker 
();

  AutoLocker 
(Lockable *lockable);

  AutoLocker 
(Lockable  &lockable);

void  relock 
();

void  unlock 
();

Birnet::AutoLocker::Locker

/opt/src/beast/birnet/birnetthread.hh:172

   
  Locker 
();

virtual  ~Locker 
();

void  lock 
();

void  unlock 
();


Birnet::AutoLocker::LockerImpl

/opt/src/beast/birnet/birnetthread.hh:180
class Birnet::AutoLocker::LockerImpl
{
  Lockable *lockable;
    LockerImpl  (l);
  virtual  ~LockerImpl  ();
  void  lock  ();
  void  unlock  ();
    BIRNET_PRIVATE_CLASS_COPY  ();
};

   
  LockerImpl 
(Lockable *l);

virtual  ~LockerImpl 
();

void  lock 
();

void  unlock 
();


Birnet::Cond

/opt/src/beast/birnet/birnetthread.hh:49
class Birnet::Cond
{
  BirnetCond cond;
    BIRNET_PRIVATE_CLASS_COPY  ();
    Cond  ();
  void  signal  ();
  void  broadcast  ();
  void  wait  (m);
  void  wait_timed  (m, max_usecs);
    ~Cond  ();
};

   

  Cond 
();

void  signal 
();

void  broadcast 
();

void  wait 
(Mutex  &m);

void  wait_timed 
(Mutex  &m,
 int64   max_usecs);

  ~Cond 
();

Birnet::Mutex

/opt/src/beast/birnet/birnetthread.hh:26
class Birnet::Mutex
{
  BirnetMutex mutex;
    BIRNET_PRIVATE_CLASS_COPY  ();
    Mutex  ();
  void  lock  ();
  void  unlock  ();
  bool  trylock  ();
    ~Mutex  ();
};

   

  Mutex 
();

void  lock 
();

void  unlock 
();

bool  trylock 
();

  ~Mutex 
();

Birnet::OwnedMutex

/opt/src/beast/birnet/birnetthread.hh:89
class Birnet::OwnedMutex
{
  BirnetRecMutex  m_rec_mutex;
  Thread*volatile m_owner;
    BIRNET_PRIVATE_CLASS_COPY  ();
    OwnedMutex  ();
  void  lock  ();
  bool  trylock  ();
  void  unlock  ();
  Thread*  owner  ();
  bool  mine  ();
    ~OwnedMutex  ();
};

   

  OwnedMutex 
();

void  lock 
();

bool  trylock 
();

void  unlock 
();

Thread*  owner 
();

bool  mine 
();

  ~OwnedMutex 
();

Birnet::RecMutex

/opt/src/beast/birnet/birnetthread.hh:38
class Birnet::RecMutex
{
  BirnetRecMutex rmutex;
    BIRNET_PRIVATE_CLASS_COPY  ();
    RecMutex  ();
  void  lock  ();
  void  unlock  ();
  bool  trylock  ();
    ~RecMutex  ();
};

   

  RecMutex 
();

void  lock 
();

void  unlock 
();

bool  trylock 
();

  ~RecMutex 
();

Birnet::Thread

/opt/src/beast/birnet/birnetthread.hh:103
class Birnet::Thread
{
  DataList      data_list;
  BirnetThread *bthread;
  OwnedMutex    m_omutex;
    Thread  (name);
  void  run  ();
  virtual  ~Thread  ();
  void  start  ();
  int  pid  ();
  String  name  ();
  void  queue_abort  ();
  void  abort  ();
  bool  aborted  ();
  void  wakeup  ();
  bool  running  ();
  void  wait_for_exit  ();
  void  exec_loop  ();
  void  quit_loop  ();
  void  set_data  (key, data);
  Type  get_data  (key);
  Type  swap_data  (key);
  Type  swap_data  (key, data);
  void  delete_data  (key);
  void  emit_wakeups  (stamp);
  Thread &  self  ();
    Thread  (thread);
  void  thread_lock  ();
  bool  thread_trylock  ();
  void  thread_unlock  ();
    BIRNET_PRIVATE_CLASS_COPY  ();
  void  threadxx_wrap  (cthread);
  void  threadxx_delete  (cxxthread);
};

   
  Thread 
(const String  &name);

void  run 
();

virtual  ~Thread 
();

void  start 
();

int  pid 
();

String  name 
();

void  queue_abort 
();

void  abort 
();

bool  aborted 
();

void  wakeup 
();

bool  running 
();


void  exec_loop 
();

void  quit_loop 
();

void  set_data 
(DataKey< Type > *key,
 Type             data);

Type  get_data 
(DataKey< Type > *key);

Type  swap_data 
(DataKey< Type > *key);

Type  swap_data 
(DataKey< Type > *key,
 Type             data);

void  delete_data 
(DataKey< Type > *key);

void  emit_wakeups 
(uint64 stamp);

Thread &  self 
();

  Thread 
(BirnetThread *thread);

void  thread_lock 
();

bool  thread_trylock 
();



void  threadxx_wrap 
(BirnetThread *cthread);

void  threadxx_delete 
(void *cxxthread);

Birnet::Thread::Self

/opt/src/beast/birnet/birnetthread.hh:125

   
String  name 
();

void  name 
(const String  &name);

bool  sleep 
(long max_useconds);
This is a wrapper for birnet_thread_sleep().
max_useconds: maximum amount of micro seconds to sleep (-1 for infinite time)
returns: TRUE while the thread should continue execution


bool  aborted 
();

int  pid 
();

void  awake_after 
(uint64 stamp);

void  set_wakeup 
(BirnetThreadWakeup wakeup_func,
 void              *wakeup_data,
 void(*)(void     *)destroy_data);

OwnedMutex &  owned_mutex 
();

void  yield 
();

void  exit 
(void *retval);

full_barrier

/opt/src/beast/birnet/birnetthread.hh:65

int_add

/opt/src/beast/birnet/birnetthread.hh:70
void  int_add 
(volatile int *iptr,
 int           diff);

int_cas

/opt/src/beast/birnet/birnetthread.hh:69
bool  int_cas 
(volatile int *iptr,
 int           o,
 int           n);

int_get

/opt/src/beast/birnet/birnetthread.hh:68
int  int_get 
(volatile int *iptr);

int_set

/opt/src/beast/birnet/birnetthread.hh:67
void  int_set 
(volatile int *iptr,
 int           value);

int_swap_add

/opt/src/beast/birnet/birnetthread.hh:71
int  int_swap_add 
(volatile int *iptr,
 int           diff);

ptr_cas

/opt/src/beast/birnet/birnetthread.hh:86
bool  ptr_cas 
(V*volatile *ptr_adr,
 V          *o,
 V          *n);

ptr_get

/opt/src/beast/birnet/birnetthread.hh:82
V*  ptr_get 
(V*volatile *ptr_addr);

ptr_get

/opt/src/beast/birnet/birnetthread.hh:84
V*  ptr_get 
(V*volatile const *ptr_addr);

ptr_set

/opt/src/beast/birnet/birnetthread.hh:80
void  ptr_set 
(V*volatile *ptr_addr,
 V          *n);

read_barrier

/opt/src/beast/birnet/birnetthread.hh:63

uint_add

/opt/src/beast/birnet/birnetthread.hh:76
void  uint_add 
(volatile uint *uptr,
 uint           diff);

uint_cas

/opt/src/beast/birnet/birnetthread.hh:75
bool  uint_cas 
(volatile uint *uptr,
 uint           o,
 uint           n);

uint_get

/opt/src/beast/birnet/birnetthread.hh:74
uint  uint_get 
(volatile uint *uptr);

uint_set

/opt/src/beast/birnet/birnetthread.hh:73
void  uint_set 
(volatile uint *uptr,
 uint           value);

uint_swap_add

/opt/src/beast/birnet/birnetthread.hh:77
uint  uint_swap_add 
(volatile uint *uptr,
 uint           diff);

write_barrier

/opt/src/beast/birnet/birnetthread.hh:64