OpenShot Audio Library | OpenShotAudio: juce::ScopedReadLock Class Reference

OpenShot Audio Library | OpenShotAudio 0.4.0

Loading...
Searching...
No Matches
Public Member Functions | List of all members
juce::ScopedReadLock Class Reference

`#include <juce_ScopedReadLock.h>`

## Public Member Functions
| ScopedReadLock (const ReadWriteLock &lock) noexcept
| ~ScopedReadLock () noexcept

## Detailed Description

Automatically locks and unlocks a ReadWriteLock object.

Use one of these as a local variable to control access to a ReadWriteLock.

e.g.

ReadWriteLock myLock;
for (;;)
{
const ScopedReadLock myScopedLock (myLock);
// myLock is now locked
...do some stuff...
// myLock gets unlocked here.
}
juce::ReadWriteLock
Definition juce_ReadWriteLock.h:48
juce::ScopedReadLock
Definition juce_ScopedReadLock.h:52

See also
  ReadWriteLock, ScopedWriteLock

Definition at line 51 of file juce_ScopedReadLock.h.

## Constructor & Destructor Documentation

## ◆ ScopedReadLock()

juce::ScopedReadLock::ScopedReadLock | ( | const ReadWriteLock & | lock | ) |
| inlineexplicitnoexcept

Creates a ScopedReadLock.

As soon as it is created, this will call ReadWriteLock::enterRead(), and when the ScopedReadLock object is deleted, the ReadWriteLock will be unlocked.

Make sure this object is created and deleted by the same thread, otherwise there are no guarantees what will happen! Best just to use it as a local stack object, rather than creating one with the new() operator.

Definition at line 65 of file juce_ScopedReadLock.h.

## ◆ ~ScopedReadLock()

juce::ScopedReadLock::~ScopedReadLock | ( |  | ) |
| inlinenoexcept

Destructor.

The ReadWriteLock's exitRead() method will be called when the destructor is called.

Make sure this object is created and deleted by the same thread, otherwise there are no guarantees what will happen!

Definition at line 74 of file juce_ScopedReadLock.h.

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

- juce_ScopedReadLock.h