# 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:

[legend]
List of all members.

## Public Member Functions

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

## Private Member Functions

| Token_Guard (void)

## Private Attributes

ACE_Dev_Poll_Reactor_Token & | token_
| The Reactor token.
int | 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

ACE_INLINE ACE_Dev_Poll_Reactor::Token_Guard::Token_Guard | ( | ACE_Dev_Poll_Reactor_Token & | token | ) |

| Constructor that will grab the token for us.

ACE_INLINE ACE_Dev_Poll_Reactor::Token_Guard::~Token_Guard | ( | void |  | ) |

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

ACE_Dev_Poll_Reactor::Token_Guard::Token_Guard | ( | void |  | ) | `[private]`

## Member Function Documentation

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.

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, and also queueing up behind other threads waiting to modify event records.

ACE_INLINE int ACE_Dev_Poll_Reactor::Token_Guard::is_owner | ( | void |  | ) |

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

ACE_INLINE void ACE_Dev_Poll_Reactor::Token_Guard::release_token | ( | void |  | ) |

| Release the token ..

## Member Data Documentation

int 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 0 indicates that this class hasn't got the token (and hence the thread) and a value of 1 vice-versa.

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:

- Dev_Poll_Reactor.h
- Dev_Poll_Reactor.cpp
- Dev_Poll_Reactor.inl