34 #ifndef _QORE_VRMUTEX_H
36 #define _QORE_VRMUTEX_H
38 #include "qore/intern/AbstractSmartLock.h"
39 #include "qore/intern/VLock.h"
42 class VRMutex :
public AbstractSmartLock {
46 DLLLOCAL
virtual int releaseImpl();
48 DLLLOCAL
virtual int grabImpl(
int mtid, VLock *nvl,
ExceptionSink *xsink,
int64 timeout_ms = 0);
49 DLLLOCAL
virtual int tryGrabImpl(
int mtid, VLock *nvl);
50 DLLLOCAL
virtual void cleanupImpl();
61 DLLLOCAL
virtual const char* getName()
const {
return "VRMutex"; }
63 DLLLOCAL
int get_count()
const {
68 class VRMutexOptionalLockHelper {
73 DLLLOCAL VRMutexOptionalLockHelper(VRMutex* vm,
ExceptionSink* xsink) : m(vm && vm->enter(xsink) >= 0 ? vm : 0) {
77 DLLLOCAL ~VRMutexOptionalLockHelper() {