oasys::NoLock Class Reference

#include <NoLock.h>

Inheritance diagram for oasys::NoLock:

oasys::Lock oasys::Logger List of all members.

Detailed Description

Class that implements the function signature of the Lock class but doesn't actually do anything.

Note, however, that is_locked() and is_locked_by_me() will never actually return true.

Useful in cases where you want to decide at runtime whether or not to enable some locking code by either creating a real lock or this class, but then you don't have to update all the call sites with an if statement.

Definition at line 34 of file NoLock.h.

Public Member Functions

int lock (const char *lock_user)
 Acquire the lock.
int unlock ()
 Release the lock.
int try_lock (const char *lock_user)
 Try to acquire the lock.


Member Function Documentation

int oasys::NoLock::lock ( const char *  lock_user  )  [virtual]

Acquire the lock.

Returns:
0 on success, -1 on error

Implements oasys::Lock.

Definition at line 23 of file NoLock.cc.

int oasys::NoLock::unlock (  )  [virtual]

Release the lock.

Returns:
0 on success, -1 on error

Implements oasys::Lock.

Definition at line 31 of file NoLock.cc.

int oasys::NoLock::try_lock ( const char *  lock_user  )  [virtual]

Try to acquire the lock.

Returns:
0 on success, 1 if already locked, -1 on error.

Implements oasys::Lock.

Definition at line 37 of file NoLock.cc.


The documentation for this class was generated from the following files:
Generated on Thu Jun 7 16:57:02 2007 for DTN Reference Implementation by  doxygen 1.5.1