Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
Lock.h
Go to the documentation of this file.
1#ifndef NW4HBM_UT_LOCK_H
2#define NW4HBM_UT_LOCK_H
3
4#include "inlines.h"
5#include <revolution/os.h>
6
7namespace nw4hbm {
8 namespace ut {
9 namespace detail {
10
11 inline void Lock(OSMutex& rMutex) {
12 OSLockMutex(&rMutex);
13 }
14 inline void Unlock(OSMutex& rMutex) {
15 OSUnlockMutex(&rMutex);
16 }
17
18 template <typename T>
19 class AutoLock : private NonCopyable {
20 public:
21 explicit AutoLock(T& rLockObj) : mLockObj(rLockObj) { Lock(rLockObj); }
23
24 private:
25 /* 0x00 */ T& mLockObj;
26 }; // size = 0x04
27
28 } // namespace detail
29
31
33 public:
36
37 private:
38 /* 0x00 */ BOOL mOldState;
39 }; // size = 0x04
40
41 } // namespace ut
42} // namespace nw4hbm
43
44#endif
Definition Lock.h:32
~AutoInterruptLock()
Definition Lock.h:35
AutoInterruptLock()
Definition Lock.h:34
BOOL mOldState
Definition Lock.h:38
Definition inlines.h:9
Definition Lock.h:19
T & mLockObj
Definition Lock.h:25
AutoLock(T &rLockObj)
Definition Lock.h:21
~AutoLock()
Definition Lock.h:22
asm BOOL OSRestoreInterrupts(__REGISTER BOOL level)
Definition OSInterrupt.c:106
asm BOOL OSDisableInterrupts(void)
Definition OSInterrupt.c:85
void OSUnlockMutex(OSMutex *mutex)
Definition OSMutex.c:86
void OSLockMutex(OSMutex *mutex)
Definition OSMutex.c:58
int BOOL
Definition types.h:33
void Unlock(OSMutex &rMutex)
Definition Lock.h:14
void Lock(OSMutex &rMutex)
Definition Lock.h:11
detail::AutoLock< OSMutex > AutoMutexLock
Definition Lock.h:30
Definition HBMAnmController.h:6
Definition OSMutex.h:13