31 #include <casacore/casa/aips.h> 40 #include <casacore/casa/Exceptions/Error.h> 80 int error = pthread_mutex_lock(&
itsMutex);
89 int error = pthread_mutex_unlock(&
itsMutex);
100 int error = pthread_mutex_trylock(&
itsMutex);
103 }
else if (error == EBUSY ||
117 bool trylock() {
return true; }
152 { itsMutexRef.lock(); }
156 { itsMutexRef.unlock(); }
227 std::call_once(itsFlag, fn);
264 std::call_once(itsFlag, fn, t);
Wrapper around std::call_once.
void operator()(void(*fn)(T), T t)
void unlock()
Unlock the mutex.
Type
Define the type of mutex.
~ScopedMutexLock()
The destructor automatically unlocks the mutex.
void lock()
Lock the mutex.
ScopedMutexLock(Mutex &mutex)
Create a lock on the mutex.
~Mutex() noexcept(false)
Destroy the mutex.
CallOnce: func has one arg.
bool Bool
Define the standard types used by Casacore.
Mutex & operator=(const Mutex &)
Forbid assignment.
bool trylock()
Try to lock the mutex.
Wrapper around a pthreads mutex.
Exception-safe lock/unlock of a mutex.
Exception for an error in a system call.
this file contains all the compiler specific defines
void operator()(void(*fn)())
Mutex(Type type=Auto)
Create the mutex.