Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Null_Semaphore Class Reference

Implement a do nothing <ACE_Semaphore>, i.e., all the methods are no ops. More...

`#include <Synch.h>`

List of all members.

## Public Methods
| ACE_Null_Semaphore (u_int count=1, int type=USYNC_THREAD, const ACE_TCHAR *name=0, void *=0, int max=0x7fffffff)
| ~ACE_Null_Semaphore (void)
int | remove (void)
| Return 0. More...
int | acquire (void)
| Return 0. More...
int | acquire (ACE_Time_Value &)
| Return -1 with <errno> == <ETIME>. More...
int | acquire (ACE_Time_Value *)
| Return -1 with <errno> == <ETIME>. More...
int | tryacquire (void)
| Return 0. More...
int | release (void)
| Return 0. More...
int | release (size_t)
| Return 0. More...
int | acquire_write (void)
| Return 0. More...
int | tryacquire_write (void)
| Return 0. More...
int | tryacquire_write_upgrade (void)
| Return 0. More...
int | acquire_read (void)
| Return 0. More...
int | tryacquire_read (void)
| Return 0. More...
void | dump (void) const
| Dump the state of an object. More...
## Public Attributes
| ACE_ALLOC_HOOK_DECLARE
| Declare the dynamic allocation hooks. More...

## Detailed Description

Implement a do nothing <ACE_Semaphore>, i.e., all the methods are no ops.

Although the methods are no-ops, the return values are different for the blocking as opposed to timed acquires. The blocking version of acquire() is often used to serialize access to a critical section, whereas the timed version is often used to wait for another thread to update some condition or change some shared state. When using an ACE_Null_Semaphore, however, there's no other thread involved to change a state or condition (otherwise, a null semaphore would be inappropriate). Returning an error value signifies that the state or condition has not been (and can't be) changed, which is consistent with the behavior of the threaded case where a timeout occurs before the state or condition is changed.

## Constructor & Destructor Documentation

ACE_INLINE ACE_Null_Semaphore::ACE_Null_Semaphore | ( | u_int | count = 1,
|  | int | type = USYNC_THREAD,
|  | const ACE_TCHAR * | name = 0,
|  | void * | = 0,
|  | int | max = 0x7fffffff
| ) |

ACE_INLINE ACE_Null_Semaphore::~ACE_Null_Semaphore | ( | void |  | ) |

## Member Function Documentation

ACE_INLINE int ACE_Null_Semaphore::acquire | ( | ACE_Time_Value * |  | ) |

| Return -1 with <errno> == <ETIME>.

ACE_INLINE int ACE_Null_Semaphore::acquire | ( | ACE_Time_Value & |  | ) |

| Return -1 with <errno> == <ETIME>.

ACE_INLINE int ACE_Null_Semaphore::acquire | ( | void |  | ) |

| Return 0.

ACE_INLINE int ACE_Null_Semaphore::acquire_read | ( | void |  | ) |

| Return 0.

ACE_INLINE int ACE_Null_Semaphore::acquire_write | ( | void |  | ) |

| Return 0.

ACE_INLINE void ACE_Null_Semaphore::dump | ( | void |  | ) | const

| Dump the state of an object.

ACE_INLINE int ACE_Null_Semaphore::release | ( | size_t |  | ) |

| Return 0.

ACE_INLINE int ACE_Null_Semaphore::release | ( | void |  | ) |

| Return 0.

ACE_INLINE int ACE_Null_Semaphore::remove | ( | void |  | ) |

| Return 0.

ACE_INLINE int ACE_Null_Semaphore::tryacquire | ( | void |  | ) |

| Return 0.

ACE_INLINE int ACE_Null_Semaphore::tryacquire_read | ( | void |  | ) |

| Return 0.

ACE_INLINE int ACE_Null_Semaphore::tryacquire_write | ( | void |  | ) |

| Return 0.

ACE_INLINE int ACE_Null_Semaphore::tryacquire_write_upgrade | ( | void |  | ) |

| Return 0.

## Member Data Documentation

ACE_Null_Semaphore::ACE_ALLOC_HOOK_DECLARE

| Declare the dynamic allocation hooks.

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

- Synch.h
- Synch.i