ruby-changes:51951
From: mame <ko1@a...>
Date: Fri, 3 Aug 2018 14:11:26 +0900 (JST)
Subject: [ruby-changes:51951] mame:r64166 (trunk): thread_pthread.c: add a macro guard for PTHREAD_CANCEL_ENABLE
mame 2018-08-03 14:11:20 +0900 (Fri, 03 Aug 2018) New Revision: 64166 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64166 Log: thread_pthread.c: add a macro guard for PTHREAD_CANCEL_ENABLE It seems to be unavailable on some platforms including my Android phone. Modified files: trunk/thread_pthread.c Index: thread_pthread.c =================================================================== --- thread_pthread.c (revision 64165) +++ thread_pthread.c (revision 64166) @@ -1551,9 +1551,11 @@ mjit_worker(void *arg) https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1551 { 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/