mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
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
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue