1
#ifndef _XMLRPCMUTEX_H_
2
#define _XMLRPCMUTEX_H_
4
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
7
# pragma warning(disable:4786) // identifier was truncated in debug info
12
//! A simple platform-independent mutex API implemented for posix and windows.
15
//! Construct a Mutex object.
16
XmlRpcMutex() : _pMutex(0) {}
18
//! Destroy a Mutex object.
21
//! Wait for the mutex to be available and then acquire the lock.
24
//! Release the mutex.
27
//! Utility class to acquire a mutex at construction and release it when destroyed.
29
//! Acquire the mutex at construction
30
AutoLock(XmlRpcMutex& m) : _m(m) { _m.acquire(); }
31
//! Release at destruction
32
~AutoLock() { _m.release(); }
33
//! The mutex being held
39
//! Native Mutex object
42
}; // class XmlRpcMutex
46
#endif // _XMLRPCMUTEX_H_