2021-03-28 22:49:05 +02:00
|
|
|
#ifndef OSMUTEX_H
|
|
|
|
|
#define OSMUTEX_H
|
|
|
|
|
|
2022-08-30 14:22:17 -07:00
|
|
|
#include "dolphin/os/OSThread.h"
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-11-11 10:09:48 -08:00
|
|
|
typedef struct OSMutex {
|
|
|
|
|
/* 0x00 */ OSThreadQueue queue;
|
|
|
|
|
/* 0x08 */ OSThread* thread;
|
|
|
|
|
/* 0x0C */ s32 count;
|
|
|
|
|
/* 0x10 */ OSMutexLink link;
|
|
|
|
|
} OSMutex; // Size: 0x18
|
|
|
|
|
|
2023-01-02 11:20:10 -08:00
|
|
|
typedef struct OSCond {
|
|
|
|
|
OSThreadQueue queue;
|
|
|
|
|
} OSCond;
|
|
|
|
|
|
2022-11-11 10:09:48 -08:00
|
|
|
void OSInitMutex(OSMutex* mutex);
|
|
|
|
|
void OSLockMutex(OSMutex* mutex);
|
|
|
|
|
void OSUnlockMutex(OSMutex* mutex);
|
2023-01-24 22:22:40 +02:00
|
|
|
BOOL OSTryLockMutex(OSMutex* mutex);
|
2022-11-11 10:09:48 -08:00
|
|
|
void OSInitCond(OSCond* cond);
|
|
|
|
|
void OSWaitCond(OSCond* cond, OSMutex* mutex);
|
|
|
|
|
void OSSignalCond(OSCond* cond);
|
2023-01-02 11:20:10 -08:00
|
|
|
|
|
|
|
|
void __OSUnlockAllMutex(OSThread* thread);
|
2023-01-24 22:22:40 +02:00
|
|
|
BOOL __OSCheckMutex(OSMutex* thread);
|
2022-11-11 10:09:48 -08:00
|
|
|
BOOL __OSCheckDeadLock(OSThread* thread);
|
|
|
|
|
BOOL __OSCheckMutexes(OSThread* thread);
|
2022-08-30 14:22:17 -07:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
};
|
|
|
|
|
#endif
|
2021-03-28 22:49:05 +02:00
|
|
|
|
|
|
|
|
#endif /* OSMUTEX_H */
|