-
Notifications
You must be signed in to change notification settings - Fork 0
read_lock
Danyil Melnytskyi edited this page Jun 10, 2024
·
1 revision
class read_lock {
task_rw_mutex& mutex;
public:
read_lock(task_rw_mutex& mutex)
: mutex(mutex) {
mutex.read_lock();
}
~read_lock() {
mutex.read_unlock();
}
};This class implements the RAIL read lock/unlock for task_rw_mutex.
fast_task::task_rw_mutex mutex;
//...
{
fast_task::read_lock lock(mutex);
//...
}