#include <Lock.h>
Only locks if true. Useful for cases where locking is optional, but putting things in an if scope will null the scope of the ScopeLock.
Definition at line 231 of file Lock.h.
Public Member Functions | |
ScopeLockIf (Lock *l, const char *lock_user, bool use_lock) | |
ScopeLockIf (const Lock *l, const char *lock_user, bool use_lock) | |
ScopeLockIf (oasys::ScopePtr< Lock > l, const char *lock_user, bool use_lock) | |
ScopeLockIf (std::auto_ptr< Lock > l, const char *lock_user, bool use_lock) | |
void | do_lock (const char *lock_user) |
void | unlock () |
~ScopeLockIf () | |
Protected Attributes | |
Lock * | lock_ |
bool | use_lock_ |
oasys::ScopeLockIf::ScopeLockIf | ( | oasys::ScopePtr< Lock > | l, | |
const char * | lock_user, | |||
bool | use_lock | |||
) | [inline] |
oasys::ScopeLockIf::~ScopeLockIf | ( | ) | [inline] |
void oasys::ScopeLockIf::do_lock | ( | const char * | lock_user | ) | [inline] |
Definition at line 265 of file Lock.h.
References ASSERT, oasys::Lock::lock(), lock_, oasys::Lock::scope_lock_count_, and use_lock_.
Referenced by ScopeLockIf().
void oasys::ScopeLockIf::unlock | ( | ) | [inline] |
Definition at line 274 of file Lock.h.
References lock_, oasys::Lock::scope_lock_count_, oasys::Lock::unlock(), and use_lock_.
Referenced by ~ScopeLockIf().
Lock* oasys::ScopeLockIf::lock_ [protected] |
bool oasys::ScopeLockIf::use_lock_ [protected] |