JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::InterProcessLock::ScopedLockType Class Reference

Automatically locks and unlocks an InterProcessLock object. More...

#include <juce_InterProcessLock.h>

Collaboration diagram for juce::InterProcessLock::ScopedLockType:

Public Member Functions

 ScopedLockType (InterProcessLock &l)
 Creates a scoped lock. More...
 
 ~ScopedLockType ()
 Destructor. More...
 
bool isLocked () const noexcept
 Returns true if the InterProcessLock was successfully locked. More...
 

Private Attributes

InterProcessLockipLock
 
bool lockWasSuccessful
 

Detailed Description

Automatically locks and unlocks an InterProcessLock object.

This works like a ScopedLock, but using an InterprocessLock rather than a CriticalSection.

See also
ScopedLock

Constructor & Destructor Documentation

◆ ScopedLockType()

juce::InterProcessLock::ScopedLockType::ScopedLockType ( InterProcessLock l)
inlineexplicit

Creates a scoped lock.

As soon as it is created, this will lock the InterProcessLock, and when the ScopedLockType object is deleted, the InterProcessLock will be unlocked.

Note that since an InterprocessLock can fail due to errors, you should check isLocked() to make sure that the lock was successful before using it.

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.

References juce::InterProcessLock::enter().

◆ ~ScopedLockType()

juce::InterProcessLock::ScopedLockType::~ScopedLockType ( )
inline

Destructor.

The InterProcessLock will be unlocked 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!

Member Function Documentation

◆ isLocked()

bool juce::InterProcessLock::ScopedLockType::isLocked ( ) const
inlinenoexcept

Returns true if the InterProcessLock was successfully locked.

Member Data Documentation

◆ ipLock

InterProcessLock& juce::InterProcessLock::ScopedLockType::ipLock
private

◆ lockWasSuccessful

bool juce::InterProcessLock::ScopedLockType::lockWasSuccessful
private

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