Qore Programming Language Reference Manual  1.0.8
QC_AutoLock.dox.h
1 namespace Qore {
4 namespace Thread {
6 
35 class AutoLock {
36 
37 public:
39 
54  constructor(Mutex mutex);
55 
56 public:
58 
60  copy();
61 
62 public:
64 
71  destructor();
72 
73 public:
75 
85 nothing lock();
86 
87 public:
89 
99 int trylock();
100 
101 public:
103 
110 nothing unlock();
111 };
112 }
113 }
A helper class for the Mutex class for exception-safe Mutex handling.
Definition: QC_AutoLock.dox.h:35
A class providing an implementation for a simple thread lock.
Definition: QC_Mutex.dox.h:37
constructor(Mutex mutex)
Creates the AutoLock object based on the Mutex argument passed and immediately calls Mutex::lock() ...
copy()
Throws an exception; objects of this class cannot be copied.
int trylock()
Attempts to relock the Mutex object being managed; acquires the lock only if it is not already held; ...
nothing lock()
Attempts to relock the Mutex object being managed.
nothing unlock()
Unlocks the Mutex object being managed; wakes up one thread if any threads are blocked on this lock...
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3
destructor()
Calls Mutex::unlock() on the saved Mutex object and destroys the AutoLock object. ...