23#include "rawspeedconfig.h"
40 explicit Mutex() { omp_init_lock(&mutex); }
42 Mutex(
const Mutex&) =
delete;
43 Mutex(Mutex&&) =
delete;
44 Mutex& operator=(
const Mutex&) =
delete;
45 Mutex& operator=(Mutex&&) =
delete;
47 ~Mutex() { omp_destroy_lock(&mutex); }
52 void Lock()
ACQUIRE() { omp_set_lock(&mutex); }
55 void Unlock()
RELEASE() { omp_unset_lock(&mutex); }
58 bool TryLock()
TRY_ACQUIRE(
true) {
return omp_test_lock(&mutex); }
61 const Mutex& operator!()
const {
return *
this; }
68 explicit Mutex() =
default;
70 Mutex(
const Mutex&) =
delete;
71 Mutex(Mutex&&) =
delete;
72 Mutex& operator=(
const Mutex&) =
delete;
73 Mutex& operator=(Mutex&&) =
delete;
96 const Mutex& operator!()
const {
return *
this; }