tesses-framework/include/TessesFramework/Threading/Mutex.hpp

26 lines
484 B
C++
Raw Normal View History

2024-12-06 10:58:55 +00:00
#pragma once
2024-12-30 03:44:33 +00:00
#if defined(_WIN32)
#include <windows.h>
#elif defined(GEKKO)
2024-12-06 10:58:55 +00:00
#include <ogc/mutex.h>
#else
#include <threads.h>
#endif
namespace Tesses::Framework::Threading
{
class Mutex {
2024-12-30 03:44:33 +00:00
#if defined(_WIN32)
HANDLE mtx;
#elif defined(GEKKO)
2024-12-06 10:58:55 +00:00
mutex_t mtx;
#else
mtx_t mtx;
#endif
public:
Mutex();
void Lock();
void Unlock();
bool TryLock();
~Mutex();
};
}