.. index:: pair: class; EE::System::Lock .. _doxid-class_e_e_1_1_system_1_1_lock: class EE::System::Lock ====================== .. toctree:: :hidden: Overview ~~~~~~~~ Automatic wrapper for locking and unlocking mutexes. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Lock: private :ref:`EE::NonCopyable` { public: // construction :ref:`Lock`(:ref:`Mutex`& mutex); :ref:`~Lock`(); }; .. _details-class_e_e_1_1_system_1_1_lock: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Automatic wrapper for locking and unlocking mutexes. Construction ------------ .. index:: pair: function; Lock .. _doxid-class_e_e_1_1_system_1_1_lock_1a2d8c920a0f2270118ca26b3638046a6c: .. ref-code-block:: cpp :class: doxyrest-title-code-block Lock(:ref:`Mutex`& mutex) Construct the lock with a target mutex The mutex passed to :ref:`Lock ` is automatically locked. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - mutex - :ref:`Mutex ` to lock .. _doxid-class_e_e_1_1_system_1_1_lock_1aff61a409c21282e368c0ee868ac174f2: .. ref-code-block:: cpp :class: doxyrest-title-code-block ~Lock() Destructor The destructor of :ref:`Lock ` automatically unlocks its mutex.