version 1.3, 2006/01/30 16:17:05
|
version 1.4, 2006/07/11 18:39:28
|
|
|
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
#include <Pegasus/Common/IPCTypes.h> | #include <Pegasus/Common/IPCTypes.h> |
|
#include <Pegasus/Common/Magic.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
// exception if process already holds the lock | // exception if process already holds the lock |
// @exception Deadlock | // @exception Deadlock |
// @exception WaitFailed | // @exception WaitFailed |
void lock(PEGASUS_THREAD_TYPE caller); |
void lock(PEGASUS_THREAD_TYPE caller = pegasus_thread_self()); |
| |
// try to gain the lock - lock succeeds immediately if the | // try to gain the lock - lock succeeds immediately if the |
// mutex is not already locked. throws an exception and returns | // mutex is not already locked. throws an exception and returns |
|
|
// @exception Deadlock | // @exception Deadlock |
// @exception AlreadyLocked | // @exception AlreadyLocked |
// @exception WaitFailed | // @exception WaitFailed |
void try_lock(PEGASUS_THREAD_TYPE caller); |
void try_lock(PEGASUS_THREAD_TYPE caller = pegasus_thread_self()); |
| |
// wait for milliseconds and throw an exception then return if the wait | // wait for milliseconds and throw an exception then return if the wait |
// expires without gaining the lock. Otherwise return without throwing an | // expires without gaining the lock. Otherwise return without throwing an |
|
|
// @exception Deadlock | // @exception Deadlock |
// @exception TimeOut | // @exception TimeOut |
// @exception WaitFailed | // @exception WaitFailed |
void timed_lock( Uint32 milliseconds, PEGASUS_THREAD_TYPE caller); |
void timed_lock( |
|
Uint32 milliseconds, |
|
PEGASUS_THREAD_TYPE caller = pegasus_thread_self()); |
| |
// unlock the semaphore | // unlock the semaphore |
// @exception Permission | // @exception Permission |
|
|
Mutex(const Mutex& _mutex); | Mutex(const Mutex& _mutex); |
| |
friend class Condition; | friend class Condition; |
|
|
|
Magic<0x57D11485> _magic; |
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |