mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
26 lines
312 B
C++
26 lines
312 B
C++
#include <Core/Core.h>
|
|
|
|
class Mutex {
|
|
int count;
|
|
void *threadid;
|
|
|
|
void Enter() {
|
|
if(self_thread == threadid) {
|
|
count++;
|
|
return;
|
|
}
|
|
Enter...
|
|
threadid = self_thread
|
|
count = 1;
|
|
}
|
|
|
|
void Leave() {
|
|
if(--count != 0) return;
|
|
Leave...
|
|
}
|
|
};
|
|
|
|
CONSOLE_APP_MAIN
|
|
{
|
|
|
|
}
|