ACE 8.0.1
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ACE_Dev_Poll_Reactor::Token_Guard Class Reference

A helper class that helps grabbing, releasing and waiting on tokens for a thread that needs access to the reactor's token. More...

#include <Dev_Poll_Reactor.h>

Collaboration diagram for ACE_Dev_Poll_Reactor::Token_Guard:
Collaboration graph
[legend]

Public Member Functions

 Token_Guard (ACE_Dev_Poll_Reactor_Token &token)
 Constructor that will grab the token for us.
 
 ~Token_Guard ()
 
void release_token ()
 Release the token ..
 
bool is_owner ()
 
int acquire_quietly (ACE_Time_Value *max_wait=0)
 
int acquire (ACE_Time_Value *max_wait=0)
 

Private Member Functions

 Token_Guard ()
 

Private Attributes

ACE_Dev_Poll_Reactor_Tokentoken_
 The Reactor token.
 
bool owner_
 

Detailed Description

A helper class that helps grabbing, releasing and waiting on tokens for a thread that needs access to the reactor's token.

Constructor & Destructor Documentation

◆ Token_Guard() [1/2]

ACE_Dev_Poll_Reactor::Token_Guard::Token_Guard ( ACE_Dev_Poll_Reactor_Token & token)
inline

Constructor that will grab the token for us.

◆ ~Token_Guard()

ACE_Dev_Poll_Reactor::Token_Guard::~Token_Guard ( )
inline

Destructor. This will release the token if it hasn't been released till this point

◆ Token_Guard() [2/2]

ACE_Dev_Poll_Reactor::Token_Guard::Token_Guard ( )
private

Member Function Documentation

◆ acquire()

int ACE_Dev_Poll_Reactor::Token_Guard::acquire ( ACE_Time_Value * max_wait = 0)

A helper method that acquires the token at a high priority, and does wake the current token holder.

◆ acquire_quietly()

int ACE_Dev_Poll_Reactor::Token_Guard::acquire_quietly ( ACE_Time_Value * max_wait = 0)

A helper method that acquires the token 1) at a low priority, and 2) wait quietly for the token, not waking another thread. This is appropriate for cases where a thread wants to wait for and dispatch an event, not causing an existing waiter to relinquish the token.

◆ is_owner()

bool ACE_Dev_Poll_Reactor::Token_Guard::is_owner ( )
inline

Returns whether the thread that created this object owns the token or not.

◆ release_token()

void ACE_Dev_Poll_Reactor::Token_Guard::release_token ( )
inline

Release the token ..

Member Data Documentation

◆ owner_

bool ACE_Dev_Poll_Reactor::Token_Guard::owner_
private

Flag that indicate whether the thread that created this object owns the token or not. A value of false indicates that this class hasn't got the token (and hence the thread) and a value of true vice-versa.

◆ token_

ACE_Dev_Poll_Reactor_Token& ACE_Dev_Poll_Reactor::Token_Guard::token_
private

The Reactor token.


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