mirror of
https://github.com/devkitPro/wut.git
synced 2026-03-21 17:34:47 -05:00
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
`find . -regex '.*\.\(cpp\|hpp\|cu\|cuh\|c\|h\)' -exec clang-format -style=file -i {} \;`
32 lines
358 B
C++
32 lines
358 B
C++
#pragma once
|
|
|
|
#include <coreinit/mutex.h>
|
|
#include "coreinit/cache.h"
|
|
|
|
class MutexWrapper
|
|
{
|
|
public:
|
|
MutexWrapper() = default;
|
|
|
|
void
|
|
init(const char *name)
|
|
{
|
|
OSInitMutexEx(&mutex, name);
|
|
}
|
|
|
|
void
|
|
lock()
|
|
{
|
|
OSLockMutex(&mutex);
|
|
}
|
|
|
|
void
|
|
unlock()
|
|
{
|
|
OSUnlockMutex(&mutex);
|
|
}
|
|
|
|
private:
|
|
OSMutex mutex{};
|
|
};
|