From 4cef2c8d6b61cc517191da781f777306823a05cb Mon Sep 17 00:00:00 2001 From: mame Date: Fri, 3 Aug 2018 05:11:20 +0000 Subject: thread_pthread.c: add a macro guard for PTHREAD_CANCEL_ENABLE It seems to be unavailable on some platforms including my Android phone. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.c | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v1.2.3