hydrogen 1.2.3
AudioEngineLocking Class Reference

AudioEngineLocking. More...

#include <AudioEngine.h>

Inheritance diagram for AudioEngineLocking:
PatternList

Public Member Functions

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

Protected Member Functions

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

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.

Definition at line 729 of file AudioEngine.h.

Constructor & Destructor Documentation

◆ AudioEngineLocking()

AudioEngineLocking ( )
inline

Definition at line 751 of file AudioEngine.h.

Member Function Documentation

◆ assertAudioEngineLocked()

void assertAudioEngineLocked ( ) const
protected

Assert that the AudioEngine lock is held if needed.

Definition at line 2788 of file AudioEngine.cpp.

◆ 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.

Definition at line 747 of file AudioEngine.h.

Field Documentation

◆ m_bNeedsLock

bool m_bNeedsLock
private

Definition at line 731 of file AudioEngine.h.