31#ifndef ASYNC_MUTEX_INCLUDED
32#define ASYNC_MUTEX_INCLUDED
41#include <condition_variable>
199 static std::mutex mu;
200 static std::condition_variable lock_available_cond;
201 static std::condition_variable no_locks_waiting_cond;
202 static std::thread::id main_thread;
203 static std::thread::id lock_owner;
204 static size_t lock_wait_cnt;
205 static bool lock_handler_pending;
207 static void lockHandler(
void);
208 static void mainThreadDone(
void);
Synchronize execution from a thread with the main Async thread.
void unlock(void)
Unlock the mutex.
Mutex & operator=(const Mutex &)=delete
Assignment operator is deleted.
Mutex(const Mutex &)=delete
Copy constructor is deleted.
Mutex(void) noexcept
Default constructor.
void lock(void)
Lock the mutex.
Namespace for the asynchronous programming classes.