1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

thread.c: clear atfork functions

* thread.c (rb_thread_atfork, rb_thread_atfork_before_exec): do
  nothing unless working fork is available.
* thread_sync.c (rb_mutex_abandon_all): define only if working
  fork is available.
* thread_sync.c (rb_mutex_abandon_keeping_mutexes): ditto.
* thread_sync.c (rb_mutex_abandon_locking_mutex): ditto.
* thread_win32.c (gvl_init): never used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-05-09 01:46:37 +00:00
parent e6709f0a62
commit a46df859cc
4 changed files with 30 additions and 7 deletions

View file

@ -14,9 +14,11 @@ typedef struct rb_mutex_struct {
int allow_trap;
} rb_mutex_t;
#if defined(HAVE_WORKING_FORK)
static void rb_mutex_abandon_all(rb_mutex_t *mutexes);
static void rb_mutex_abandon_keeping_mutexes(rb_thread_t *th);
static void rb_mutex_abandon_locking_mutex(rb_thread_t *th);
#endif
static const char* rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *th);
/*
@ -378,6 +380,7 @@ rb_mutex_unlock(VALUE self)
return self;
}
#if defined(HAVE_WORKING_FORK)
static void
rb_mutex_abandon_keeping_mutexes(rb_thread_t *th)
{
@ -412,6 +415,7 @@ rb_mutex_abandon_all(rb_mutex_t *mutexes)
mutex->next_mutex = 0;
}
}
#endif
static VALUE
rb_mutex_sleep_forever(VALUE time)