Cbeam
|
Inner class providing RAII-style locking mechanism. More...
#include <thread_safe_container.hpp>
Public Member Functions | |
lock_guard (std::recursive_mutex &mutex) | |
Constructs the lock guard and locks the provided mutex. | |
~lock_guard () noexcept | |
Destructor that unlocks the mutex. | |
lock_guard (const lock_guard &)=delete | |
lock_guard & | operator= (const lock_guard &)=delete |
Inner class providing RAII-style locking mechanism.
This class implements a lock guard for thread-safe operations, utilizing a recursive mutex. It locks the mutex upon construction and unlocks it upon destruction, ensuring exception safety and preventing deadlocks in a scoped block.
|
inlineexplicit |
Constructs the lock guard and locks the provided mutex.
mutex | The mutex to be locked. |
|
inlinenoexcept |
Destructor that unlocks the mutex.
|
delete |
|
delete |