12 #ifndef __UT_ABORTABLELOCKIMPL_H_INCLUDED__
13 #define __UT_ABORTABLELOCKIMPL_H_INCLUDED__
19 template <
typename LOCKABLE>
28 if (
UT_VAR(myMutex).tryLock())
30 myImpl.markAsLocked(thread_id);
35 myImpl.markAsWaiting(thread_id);
40 if (
UT_VAR(myMutex).timedLock(timeout))
47 myImpl.markAsNotWaiting(thread_id);
48 myImpl.markAsLocked(thread_id);
52 else if (myImpl.findDeadlock(thread_id))
55 myImpl.markAsNotWaiting(thread_id);
66 template <
typename LOCKABLE>
70 if (
UT_VAR(myMutex).tryLock())
79 template <
typename LOCKABLE>
87 template <
typename LOCKABLE>
91 myImpl.markAsUnlocked();
95 template <
typename LOCKABLE>
99 return myImpl.hasLock(thread);
102 template <
typename LOCKABLE>
109 #endif // __UT_ABORTABLELOCKIMPL_H_INCLUDED__
bool safeLock()
Attempt lock on this mutex. Returns true on success, false if deadlock.
void unlock()
Release lock. Undefined if it was not previously locked.
GLbitfield GLuint64 timeout
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
bool tryLock()
Tries the lock without blocking. Returns true if the lock was obtained.
**Note that the tasks the thread_id
void lock()
Locks the underlying mutex without testing for deadlocks.