Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Unity-Technologies/bdwgc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-03-07 01:24:05 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-03-07 01:24:05 +0300
commit8a455421b8765ebce3176afa7b35a5fa82209ae2 (patch)
tree3ac520a946533903f11274566df1d7becdf2a469 /pthread_support.c
parent42ff9266117a0821a68717a8fc0ce69267524bb3 (diff)
Workaround sem_wait failure in pthread_create on Haiku
Issue #97 (bdwgc). sem_wait() fails because of some bug in Haiku OS (as of hrev51798). * pthread_support.c [GC_HAIKU_THREADS] (WRAP_FUNC(pthread_create)): If errno is EACCES then just retry sem_wait instead of ABORT.
Diffstat (limited to 'pthread_support.c')
-rw-r--r--pthread_support.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pthread_support.c b/pthread_support.c
index c12d823c..51b4a2bd 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -1897,6 +1897,10 @@ GC_INNER_PTHRSTART GC_thread GC_start_rtn_prepare_thread(
DISABLE_CANCEL(cancel_state);
/* pthread_create is not a cancellation point. */
while (0 != sem_wait(&(si -> registered))) {
+# if defined(GC_HAIKU_THREADS)
+ /* To workaround some bug in Haiku semaphores. */
+ if (EACCES == errno) continue;
+# endif
if (EINTR != errno) ABORT("sem_wait failed");
}
RESTORE_CANCEL(cancel_state);