#include <Synch_T.h>
Inheritance diagram for ACE_Reverse_Lock:


Public Types | |
| typedef ACE_LOCKING_MECHANISM | ACE_LOCK |
Public Methods | |
| ACE_Reverse_Lock (ACE_LOCKING_MECHANISM &lock, ACE_Acquire_Method::METHOD_TYPE acquire_method=ACE_Acquire_Method::ACE_REGULAR) | |
| Constructor. All locking requests will be forwarded to <lock>. More... | |
| virtual | ~ACE_Reverse_Lock (void) |
| Destructor. If <lock_> was not passed in by the user, it will be deleted. More... | |
| virtual int | acquire (void) |
| Release the lock. More... | |
| virtual int | tryacquire (void) |
| Release the lock. More... | |
| virtual int | release (void) |
| Acquire the lock. More... | |
| virtual int | acquire_read (void) |
| Release the lock. More... | |
| virtual int | acquire_write (void) |
| Release the lock. More... | |
| virtual int | tryacquire_read (void) |
| Release the lock. More... | |
| virtual int | tryacquire_write (void) |
| Release the lock. More... | |
| virtual int | tryacquire_write_upgrade (void) |
| Release the lock. More... | |
| virtual int | remove (void) |
| Explicitly destroy the lock. More... | |
Private Attributes | |
| ACE_LOCKING_MECHANISM & | lock_ |
| The concrete locking mechanism that all the methods delegate to. More... | |
| ACE_Acquire_Method::METHOD_TYPE | acquire_method_ |
| This indicates what kind of acquire method will be called. More... | |
This is an interesting adapter class that changes a lock into a reverse lock, i.e., <acquire> on this class calls <release> on the lock, and <release> on this class calls <acquire> on the lock. One motivation for this class is when we temporarily want to release a lock (which we have already acquired) but then reacquire it soon after. An alternative design would be to add a Anti_Guard or Reverse_Guard class which would <release> on construction and <acquire> destruction. However, there are *many* varieties of the Guard class and this design choice would lead to at least 6 new classes. One new ACE_Reverse_Lock class seemed more reasonable.
Definition at line 152 of file Synch_T.h.
|
|||||
|
|
|
||||||||||||||||
|
Constructor. All locking requests will be forwarded to <lock>.
Definition at line 261 of file Synch_T.i. References ACE_Acquire_Method::METHOD_TYPE.
00263 : lock_ (lock), 00264 acquire_method_ (acquire_method) 00265 { 00266 } |
|
||||||||||
|
Destructor. If <lock_> was not passed in by the user, it will be deleted.
Definition at line 33 of file Synch_T.cpp.
00034 {
00035 }
|
|
||||||||||
|
Release the lock.
Implements ACE_Lock. Definition at line 277 of file Synch_T.i. References lock_.
00278 {
00279 return this->lock_.release ();
00280 }
|
|
||||||||||
|
Release the lock.
Implements ACE_Lock. Definition at line 303 of file Synch_T.i.
00304 {
00305 ACE_NOTSUP_RETURN (-1);
00306 }
|
|
||||||||||
|
Release the lock.
Implements ACE_Lock. Definition at line 310 of file Synch_T.i.
00311 {
00312 ACE_NOTSUP_RETURN (-1);
00313 }
|
|
||||||||||
|
Acquire the lock.
Implements ACE_Lock. Definition at line 291 of file Synch_T.i. References ACE_Acquire_Method::ACE_READ, ACE_Acquire_Method::ACE_WRITE, acquire_method_, and lock_.
00292 {
00293 if (this->acquire_method_ == ACE_Acquire_Method::ACE_READ)
00294 return this->lock_.acquire_read ();
00295 else if (this->acquire_method_ == ACE_Acquire_Method::ACE_WRITE)
00296 return this->lock_.acquire_write ();
00297 else
00298 return this->lock_.acquire ();
00299 }
|
|
||||||||||
|
Explicitly destroy the lock.
Implements ACE_Lock. Definition at line 270 of file Synch_T.i. References lock_.
00271 {
00272 return this->lock_.remove ();
00273 }
|
|
||||||||||
|
Release the lock.
Implements ACE_Lock. Definition at line 284 of file Synch_T.i.
00285 {
00286 ACE_NOTSUP_RETURN (-1);
00287 }
|
|
||||||||||
|
Release the lock.
Implements ACE_Lock. Definition at line 317 of file Synch_T.i.
00318 {
00319 ACE_NOTSUP_RETURN (-1);
00320 }
|
|
||||||||||
|
Release the lock.
Implements ACE_Lock. Definition at line 324 of file Synch_T.i.
00325 {
00326 ACE_NOTSUP_RETURN (-1);
00327 }
|
|
||||||||||
|
Release the lock.
Implements ACE_Lock. Definition at line 331 of file Synch_T.i.
00332 {
00333 ACE_NOTSUP_RETURN (-1);
00334 }
|
|
|||||
|
This indicates what kind of acquire method will be called.
Definition at line 201 of file Synch_T.h. Referenced by release. |
|
|||||
|
The concrete locking mechanism that all the methods delegate to.
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002