1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Make MutexQueue use jsemaphore for signaling

This commit is contained in:
sapier 2014-01-06 12:45:42 +01:00
parent 10fdbf7375
commit 8b0b857eaa
13 changed files with 248 additions and 99 deletions

View file

@ -51,6 +51,21 @@ void JSemaphore::Wait() {
INFINITE);
}
bool JSemaphore::Wait(unsigned int time_ms) {
unsigned int retval = WaitForSingleObject(
m_hSemaphore,
time_ms);
if (retval == WAIT_OBJECT_0)
{
return true;
}
else {
assert(retval == WAIT_TIMEOUT);
return false;
}
}
int JSemaphore::GetValue() {
long int retval = 0;