forked from Mirrorlandia_minetest/minetest
Fixes #1687 by extra semaphore retval handle code for OSX
See https://github.com/minetest/minetest/issues/1687#issuecomment-56830173 Signed-off-by: Craig Robbins <kde.psych@gmail.com>
This commit is contained in:
parent
06207ac550
commit
a0ac471c1a
@ -115,6 +115,13 @@ bool JSemaphore::Wait(unsigned int time_ms) {
|
||||
errno = 0;
|
||||
#ifdef __MACH__
|
||||
int sem_wait_retval = semaphore_timedwait(m_semaphore, waittime);
|
||||
if (sem_wait_retval == KERN_OPERATION_TIMED_OUT) {
|
||||
errno = ETIMEDOUT;
|
||||
} else if (sem_wait_retval == KERN_ABORTED) {
|
||||
errno = EINTR;
|
||||
} else if (sem_wait_retval != 0) {
|
||||
errno = EINVAL;
|
||||
}
|
||||
#else
|
||||
int sem_wait_retval = sem_timedwait(&m_semaphore, &waittime);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user