summaryrefslogtreecommitdiff
path: root/include/JSystem/JAudio2/JASCriticalSection.h
blob: d737eb79a63e1d80fbab71ccfe2412baa25182cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef JASCRITICALSECTION_H
#define JASCRITICALSECTION_H

#include "dolphin/os/OSInterrupt.h"

/**
 * @ingroup jsystem-jaudio
 * 
 */
class JASCriticalSection {
public:
    JASCriticalSection() { mInterruptState = OSDisableInterrupts(); };
    ~JASCriticalSection() { OSRestoreInterrupts(mInterruptState); };

private:
    u32 mInterruptState;
};

#endif /* JASCRITICALSECTION_H */