Issue #97 (bdwgc).
The underlying pthread_join fails because of some bug in Haiku OS
(as of hrev51798) when many threads are created in parallel.
* tests/subthread_create.c [__HAIKU__]: Include errno.h.
* tests/subthread_create.c [__HAIKU__] (main): If pthread_join returned
value is ESRCH then just end the test normally (i.e. ignore the failure
of pthread_join); add comment and TODO item.
# include <windows.h>
#endif
+#if defined(__HAIKU__)
+# include <errno.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
err = pthread_join(th[i], &res);
if (err) {
fprintf(stderr, "Failed to join thread: %s\n", strerror(err));
+# if defined(__HAIKU__)
+ /* The error is just ignored (and the test is ended) to */
+ /* workaround some bug in Haiku pthread_join. */
+ /* TODO: The thread is not deleted from GC_threads. */
+ if (ESRCH == err) break;
+# endif
exit(1);
}
# else