mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-22 06:56:31 -04:00
26 lines
451 B
C++
26 lines
451 B
C++
#ifndef JASCRITICALSECTION_H
|
|
#define JASCRITICALSECTION_H
|
|
|
|
#include <os.h>
|
|
|
|
/**
|
|
* @ingroup jsystem-jaudio
|
|
*
|
|
*/
|
|
class JASCriticalSection {
|
|
public:
|
|
#if TARGET_PC
|
|
JASCriticalSection();
|
|
~JASCriticalSection();
|
|
#else
|
|
public:
|
|
JASCriticalSection() { mInterruptState = OSDisableInterrupts(); };
|
|
~JASCriticalSection() { OSRestoreInterrupts(mInterruptState); };
|
|
|
|
private:
|
|
u32 mInterruptState;
|
|
#endif
|
|
};
|
|
|
|
#endif /* JASCRITICALSECTION_H */
|