class EE::System::Lock

Overview

Automatic wrapper for locking and unlocking mutexes. More…

#include <lock.hpp>

class Lock: private EE::NonCopyable {
public:
    // construction

    Lock(Mutex& mutex);
    ~Lock();
};

Detailed Documentation

Automatic wrapper for locking and unlocking mutexes.

Construction

Lock(Mutex& mutex)

Construct the lock with a target mutex The mutex passed to Lock is automatically locked.

Parameters:

mutex

Mutex to lock

~Lock()

Destructor The destructor of Lock automatically unlocks its mutex.