summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--thread_pthread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index b095c2ef1c..39b8e79f49 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1551,9 +1551,11 @@ mjit_worker(void *arg)
{
void (*worker_func)(void) = (void(*)(void))arg;
+#ifdef PTHREAD_CANCEL_ENABLE
if (pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) != 0) {
fprintf(stderr, "Cannot enable cancellation in MJIT worker\n");
}
+#endif
#ifdef SET_CURRENT_THREAD_NAME
SET_CURRENT_THREAD_NAME("ruby-mjitworker"); /* 16 byte including NUL */
#endif