.. oe:namespace:: OEPlatform


.. meta::
   :keywords: OEMutex, Mutex


.. _OEPlatform_OEMutex:

.. oe:class:: OEMutex

   .. oe:api::

      struct OEMutex

   The :ref:`OEMutex <OEPlatform_OEMutex>` class provides a portable MUTual
   EXclusion device, that is useful for protecting shared data structures 
   from concurrent modification.

   .. seealso::

      * :ref:`OELock <OEPlatform_OELock>` class
      * :ref:`OETryMutex <OEPlatform_OETryMutex>` class

   .. oe:method:: Constructors

      .. oe:api::

         OEMutex()

      Default constructor.

   .. oe:method:: Acquire

      .. oe:api::

         void Acquire()

      Acquires (locks) the :ref:`OEMutex <OEPlatform_OEMutex>`. If the
      :ref:`OEMutex <OEPlatform_OEMutex>` is unlocked, it is locked by this calls
      and becomes owned
      by the calling thread. If the :ref:`OEMutex <OEPlatform_OEMutex>` is already
      locked, by this or another thread, :oe:meth:`OEPlatform::OEMutex::Acquire`
      suspends the calling thread until the :ref:`OEMutex <OEPlatform_OEMutex>`
      is released.

   .. oe:method:: Release

      .. oe:api::

         void Release()

      Releases (unlocks) the :ref:`OEMutex <OEPlatform_OEMutex>`. The
      :ref:`OEMutex <OEPlatform_OEMutex>` object must have previously been locked
      by the calling thread.
