ACE_Null_Semaphore Class Reference

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

#include <Null_Semaphore.h>

List of all members.

Public Member Functions

 ACE_Null_Semaphore (unsigned int=1, int=0, const ACE_TCHAR *=0, void *=0, int=0x7fffffff)
 ~ACE_Null_Semaphore (void)
int remove (void)
 Return 0.

int acquire (void)
 Return 0.

int acquire (ACE_Time_Value &)
 Return -1 with == .

int acquire (ACE_Time_Value *)
 Return -1 with == .

int tryacquire (void)
 Return 0.

int release (void)
 Return 0.

int release (size_t)
 Return 0.

int acquire_write (void)
 Return 0.

int tryacquire_write (void)
 Return 0.

int tryacquire_write_upgrade (void)
 Return 0.

int acquire_read (void)
 Return 0.

int tryacquire_read (void)
 Return 0.

void dump (void) const
 Dump the state of an object.


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.

Definition at line 49 of file Null_Semaphore.h.


Constructor & Destructor Documentation

ACE_Null_Semaphore::ACE_Null_Semaphore unsigned  int = 1,
int  = 0,
const ACE_TCHAR = 0,
void *  = 0,
int  = 0x7fffffff
[inline]
 

Definition at line 52 of file Null_Semaphore.h.

References ACE_TCHAR.

00056                                          {}

ACE_Null_Semaphore::~ACE_Null_Semaphore void   )  [inline]
 

Definition at line 57 of file Null_Semaphore.h.

00057 {}


Member Function Documentation

int ACE_Null_Semaphore::acquire ACE_Time_Value  )  [inline]
 

Return -1 with == .

Definition at line 68 of file Null_Semaphore.h.

References ETIME.

00068 {errno = ETIME; return -1;}

int ACE_Null_Semaphore::acquire ACE_Time_Value  )  [inline]
 

Return -1 with == .

Definition at line 65 of file Null_Semaphore.h.

References ETIME.

00065 {errno = ETIME; return -1;}

int ACE_Null_Semaphore::acquire void   )  [inline]
 

Return 0.

Definition at line 62 of file Null_Semaphore.h.

00062 {return 0;}

int ACE_Null_Semaphore::acquire_read void   )  [inline]
 

Return 0.

Definition at line 89 of file Null_Semaphore.h.

00089 {return 0;}

int ACE_Null_Semaphore::acquire_write void   )  [inline]
 

Return 0.

Definition at line 80 of file Null_Semaphore.h.

00080 {return 0;}

void ACE_Null_Semaphore::dump void   )  const [inline]
 

Dump the state of an object.

Definition at line 95 of file Null_Semaphore.h.

00095 {}

int ACE_Null_Semaphore::release size_t   )  [inline]
 

Return 0.

Definition at line 77 of file Null_Semaphore.h.

00077 {return 0;}

int ACE_Null_Semaphore::release void   )  [inline]
 

Return 0.

Definition at line 74 of file Null_Semaphore.h.

00074 {return 0;}

int ACE_Null_Semaphore::remove void   )  [inline]
 

Return 0.

Definition at line 59 of file Null_Semaphore.h.

00059 {return 0;}

int ACE_Null_Semaphore::tryacquire void   )  [inline]
 

Return 0.

Definition at line 71 of file Null_Semaphore.h.

00071 {return 0;}

int ACE_Null_Semaphore::tryacquire_read void   )  [inline]
 

Return 0.

Definition at line 92 of file Null_Semaphore.h.

00092 {return 0;}

int ACE_Null_Semaphore::tryacquire_write void   )  [inline]
 

Return 0.

Definition at line 83 of file Null_Semaphore.h.

00083 {return 0;}

int ACE_Null_Semaphore::tryacquire_write_upgrade void   )  [inline]
 

Return 0.

Definition at line 86 of file Null_Semaphore.h.

00086 {return 0;}


The documentation for this class was generated from the following file:
Generated on Thu Nov 9 11:25:59 2006 for ACE by doxygen 1.3.6