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.

Definition at line 317 of file Synch.h.


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
 

Definition at line 365 of file Synch.i.

References ACE_TCHAR.

00370 {
00371 }

ACE_INLINE ACE_Null_Semaphore::~ACE_Null_Semaphore void   
 

Definition at line 374 of file Synch.i.

00375 {
00376 }


Member Function Documentation

ACE_INLINE int ACE_Null_Semaphore::acquire ACE_Time_Value  
 

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

Definition at line 392 of file Synch.i.

References ETIME.

00393 {
00394   errno = ETIME;
00395   return -1;
00396 }

ACE_INLINE int ACE_Null_Semaphore::acquire ACE_Time_Value  
 

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

Definition at line 385 of file Synch.i.

References ETIME.

00386 {
00387   errno = ETIME;
00388   return -1;
00389 }

ACE_INLINE int ACE_Null_Semaphore::acquire void   
 

Return 0.

Definition at line 399 of file Synch.i.

00400 {
00401   return 0;
00402 }

ACE_INLINE int ACE_Null_Semaphore::acquire_read void   
 

Return 0.

Definition at line 441 of file Synch.i.

00442 {
00443   return 0;
00444 }

ACE_INLINE int ACE_Null_Semaphore::acquire_write void   
 

Return 0.

Definition at line 423 of file Synch.i.

00424 {
00425   return 0;
00426 }

ACE_INLINE void ACE_Null_Semaphore::dump void    const
 

Dump the state of an object.

Definition at line 453 of file Synch.i.

00454 {
00455 }

ACE_INLINE int ACE_Null_Semaphore::release size_t   
 

Return 0.

Definition at line 411 of file Synch.i.

00412 {
00413   return 0;
00414 }

ACE_INLINE int ACE_Null_Semaphore::release void   
 

Return 0.

Definition at line 417 of file Synch.i.

00418 {
00419   return 0;
00420 }

ACE_INLINE int ACE_Null_Semaphore::remove void   
 

Return 0.

Definition at line 379 of file Synch.i.

00380 {
00381   return 0;
00382 }

ACE_INLINE int ACE_Null_Semaphore::tryacquire void   
 

Return 0.

Definition at line 405 of file Synch.i.

00406 {
00407   return 0;
00408 }

ACE_INLINE int ACE_Null_Semaphore::tryacquire_read void   
 

Return 0.

Definition at line 447 of file Synch.i.

00448 {
00449   return 0;
00450 }

ACE_INLINE int ACE_Null_Semaphore::tryacquire_write void   
 

Return 0.

Definition at line 429 of file Synch.i.

00430 {
00431   return 0;
00432 }

ACE_INLINE int ACE_Null_Semaphore::tryacquire_write_upgrade void   
 

Return 0.

Definition at line 435 of file Synch.i.

00436 {
00437   return 0;
00438 }


Member Data Documentation

ACE_Null_Semaphore::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 366 of file Synch.h.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:51:14 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002