hydrogen 1.1.1
AudioEngineLocking Class Reference

AudioEngineLocking. More...

#include <AudioEngine.h>

Inheritance diagram for AudioEngineLocking:
PatternList

Public Member Functions

void setNeedsLock (bool bNeedsLock)
 The audio processing thread can modify some PatternLists. More...
 
 AudioEngineLocking ()
 

Protected Member Functions

void assertAudioEngineLocked () const
 Assert that the AudioEngine lock is held if needed. More...
 

Private Attributes

bool m_bNeedsLock
 

Detailed Description

AudioEngineLocking.

This is a base class for shared data structures which may be modified by the AudioEngine. These should only be modified or trusted by a thread holding the AudioEngine lock.

Any class which implements a data structure which can be modified by the AudioEngine can inherit from this, and use the protected "assertLocked()" method to ensure that methods are called only with appropriate locking.

Checking is only done on debug builds.

Constructor & Destructor Documentation

◆ AudioEngineLocking()

AudioEngineLocking ( )
inline

Member Function Documentation

◆ assertAudioEngineLocked()

void assertAudioEngineLocked ( ) const
inlineprotected

Assert that the AudioEngine lock is held if needed.

◆ setNeedsLock()

void setNeedsLock ( bool  bNeedsLock)
inline

The audio processing thread can modify some PatternLists.

For these structures, the audio engine lock must be held for any thread to access them.

Field Documentation

◆ m_bNeedsLock

bool m_bNeedsLock
private