#include <Synch.h>
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... | |
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.
|
||||||||||||||||||||||||
|
Definition at line 365 of file Synch.i. References ACE_TCHAR.
00370 {
00371 }
|
|
|
Definition at line 374 of file Synch.i.
00375 {
00376 }
|
|
|
Return -1 with <errno> == <ETIME>.
Definition at line 392 of file Synch.i. References ETIME.
00393 {
00394 errno = ETIME;
00395 return -1;
00396 }
|
|
|
Return -1 with <errno> == <ETIME>.
Definition at line 385 of file Synch.i. References ETIME.
00386 {
00387 errno = ETIME;
00388 return -1;
00389 }
|
|
|
Return 0.
Definition at line 399 of file Synch.i.
00400 {
00401 return 0;
00402 }
|
|
|
Return 0.
Definition at line 441 of file Synch.i.
00442 {
00443 return 0;
00444 }
|
|
|
Return 0.
Definition at line 423 of file Synch.i.
00424 {
00425 return 0;
00426 }
|
|
|
Dump the state of an object.
Definition at line 453 of file Synch.i.
00454 {
00455 }
|
|
|
Return 0.
Definition at line 411 of file Synch.i.
00412 {
00413 return 0;
00414 }
|
|
|
Return 0.
Definition at line 417 of file Synch.i.
00418 {
00419 return 0;
00420 }
|
|
|
Return 0.
Definition at line 379 of file Synch.i.
00380 {
00381 return 0;
00382 }
|
|
|
Return 0.
Definition at line 405 of file Synch.i.
00406 {
00407 return 0;
00408 }
|
|
|
Return 0.
Definition at line 447 of file Synch.i.
00448 {
00449 return 0;
00450 }
|
|
|
Return 0.
Definition at line 429 of file Synch.i.
00430 {
00431 return 0;
00432 }
|
|
|
Return 0.
Definition at line 435 of file Synch.i.
00436 {
00437 return 0;
00438 }
|
|
|
Declare the dynamic allocation hooks.
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002