thread_pthread.c: no fork, no gvl_atfork

* thread_pthread.c (gvl_atfork): used in rb_thread_atfork_internal
  only if HAVE_WORKING_FORK is defined.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-05-20 14:24:39 +00:00
parent 8a77596858
commit a716a2474b

View File

@ -181,12 +181,14 @@ gvl_destroy(rb_vm_t *vm)
native_mutex_destroy(&vm->gvl.lock); native_mutex_destroy(&vm->gvl.lock);
} }
#if defined(HAVE_WORKING_FORK)
static void static void
gvl_atfork(rb_vm_t *vm) gvl_atfork(rb_vm_t *vm)
{ {
gvl_init(vm); gvl_init(vm);
gvl_acquire(vm, GET_THREAD()); gvl_acquire(vm, GET_THREAD());
} }
#endif
#define NATIVE_MUTEX_LOCK_DEBUG 0 #define NATIVE_MUTEX_LOCK_DEBUG 0