Audacity  2.2.2
Public Member Functions | List of all members
ODLocker Class Reference

#include <ODTaskThread.h>

Inheritance diagram for ODLocker:

Public Member Functions

 ODLocker (ODLock *p=nullptr, bool tryOnly=false)
 
void reset (ODLock *p=nullptr, bool tryOnly=false)
 
 ODLocker (ODLocker &&that)
 
ODLockeroperator= (ODLocker &&that)
 
 ODLocker (const ODLocker &that) PROHIBITED
 
ODLockeroperator= (const ODLocker &that) PROHIBITED
 

Detailed Description

Definition at line 182 of file ODTaskThread.h.

Constructor & Destructor Documentation

ODLocker::ODLocker ( ODLock p = nullptr,
bool  tryOnly = false 
)
inlineexplicit

Definition at line 185 of file ODTaskThread.h.

References reset().

186  {
187  reset(p, tryOnly);
188  }
void reset(ODLock *p=nullptr, bool tryOnly=false)
Definition: ODTaskThread.h:190
ODLocker::ODLocker ( ODLocker &&  that)
inline

Definition at line 204 of file ODTaskThread.h.

204 : ODLockerBase { std::move(that) } {}
std::unique_ptr< ODLock, ODUnlocker > ODLockerBase
Definition: ODTaskThread.h:181
ODLocker::ODLocker ( const ODLocker that)

Member Function Documentation

ODLocker& ODLocker::operator= ( ODLocker &&  that)
inline

Definition at line 205 of file ODTaskThread.h.

205  {
206  ODLockerBase::operator= ( std::move(that) );
207  return *this;
208  }
ODLocker& ODLocker::operator= ( const ODLocker that)
void ODLocker::reset ( ODLock p = nullptr,
bool  tryOnly = false 
)
inline

Definition at line 190 of file ODTaskThread.h.

Referenced by ODLocker().

191  {
192  ODLockerBase::reset(p);
193  if(p) {
194  if (tryOnly) {
195  if (p->TryLock() != 0)
196  ODLockerBase::reset(nullptr);
197  }
198  else
199  p->Lock();
200  }
201  }

The documentation for this class was generated from the following file: