version 1.10, 2007/08/02 08:06:53
|
version 1.15, 2008/10/17 11:07:33
|
|
|
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
#include <Pegasus/Common/IPCExceptions.h> |
|
#include <Pegasus/Common/Magic.h> | #include <Pegasus/Common/Magic.h> |
#include <Pegasus/Common/Threads.h> | #include <Pegasus/Common/Threads.h> |
| |
|
|
| |
void lock(); | void lock(); |
| |
void try_lock(); |
/** |
|
Attempts to lock the mutex without blocking. |
|
@return A Boolean indicating whether the lock was acquired. |
|
*/ |
|
Boolean try_lock(); |
| |
void timed_lock(Uint32 milliseconds); |
/** |
|
Attempts to lock the mutex within the specified time. |
|
@param milliseconds The maximum time to block while attempting to |
|
acquire the lock. |
|
@return A Boolean indicating whether the lock was acquired. |
|
*/ |
|
Boolean timed_lock(Uint32 milliseconds); |
| |
void unlock(); | void unlock(); |
| |
#if defined(PEGASUS_OS_LINUX) |
#if defined(PEGASUS_OS_LINUX) || \ |
|
(defined(PEGASUS_OS_ZOS) && !(__TARGET_LIB__ < 0x41090000)) |
/** | /** |
This method must only be called after a fork() to reset the mutex | This method must only be called after a fork() to reset the mutex |
lock status in the new process. Any other use of this method is | lock status in the new process. Any other use of this method is |
|
|
| |
#if !defined(PEGASUS_HAVE_PTHREADS) || \ | #if !defined(PEGASUS_HAVE_PTHREADS) || \ |
(defined(PEGASUS_OS_ZOS) && (__TARGET_LIB__ < 0x41090000)) || \ | (defined(PEGASUS_OS_ZOS) && (__TARGET_LIB__ < 0x41090000)) || \ |
|
defined(PEGASUS_PLATFORM_ZOS_ZSERIES64_IBM) || \ |
defined(PEGASUS_OS_VMS) | defined(PEGASUS_OS_VMS) |
| |
# define PEGASUS_FORK_SAFE_MUTEX(mutex) | # define PEGASUS_FORK_SAFE_MUTEX(mutex) |
| |
#elif defined(PEGASUS_OS_LINUX) |
#elif defined(PEGASUS_OS_LINUX) || \ |
|
(defined(PEGASUS_OS_ZOS) && !(__TARGET_LIB__ < 0x41090000)) |
| |
# define PEGASUS_FORK_SAFE_MUTEX(mutex) \ | # define PEGASUS_FORK_SAFE_MUTEX(mutex) \ |
class ForkSafeMutex ## mutex \ | class ForkSafeMutex ## mutex \ |