summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-03 05:11:20 (GMT)
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-03 05:11:20 (GMT)
commit4cef2c8d6b61cc517191da781f777306823a05cb (patch)
treee3876414549b4b184e76abf5e8aefab5e1c8552b /thread_pthread.c
parent8c2ae6e3ed072b06fc3cbc34fa8a14b2acbb49d5 (diff)
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
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index b095c2e..39b8e79 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