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

#include <ODTaskThread.h>

Inheritance diagram for ODLocker:
[legend]
Collaboration diagram for ODLocker:
[legend]

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 120 of file ODTaskThread.h.

Constructor & Destructor Documentation

◆ ODLocker() [1/3]

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

Definition at line 123 of file ODTaskThread.h.

124  {
125  reset(p, tryOnly);
126  }

References reset().

Here is the call graph for this function:

◆ ODLocker() [2/3]

ODLocker::ODLocker ( ODLocker &&  that)
inline

Definition at line 142 of file ODTaskThread.h.

142 : ODLockerBase { std::move(that) } {}

◆ ODLocker() [3/3]

ODLocker::ODLocker ( const ODLocker that)

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Definition at line 143 of file ODTaskThread.h.

143  {
144  ODLockerBase::operator= ( std::move(that) );
145  return *this;
146  }

◆ reset()

void ODLocker::reset ( ODLock p = nullptr,
bool  tryOnly = false 
)
inline

Definition at line 128 of file ODTaskThread.h.

129  {
130  ODLockerBase::reset(p);
131  if(p) {
132  if (tryOnly) {
133  if (p->TryLock() != 0)
134  ODLockerBase::reset(nullptr);
135  }
136  else
137  p->Lock();
138  }
139  }

Referenced by ODLocker().

Here is the caller graph for this function:

The documentation for this class was generated from the following file:
ODLocker::reset
void reset(ODLock *p=nullptr, bool tryOnly=false)
Definition: ODTaskThread.h:128
ODLockerBase
std::unique_ptr< ODLock, ODUnlocker > ODLockerBase
Definition: ODTaskThread.h:119