From a038bf238bd9a24bf1e1622f618a27db261fc91b Mon Sep 17 00:00:00 2001 From: normal Date: Mon, 30 Jul 2018 09:54:41 +0000 Subject: thread_pthread.h (native_thread_data): split condvars on some platforms Maybe some platforms have strange condition variable implementations which have a "memory" of which mutexes they're associated with. In any case, it makes documentation easier even on GNU/Linux and FreeBSD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'thread_pthread.h') diff --git a/thread_pthread.h b/thread_pthread.h index e3f09800a3..60e0fe0ea3 100644 --- a/thread_pthread.h +++ b/thread_pthread.h @@ -22,7 +22,19 @@ typedef pthread_cond_t rb_nativethread_cond_t; typedef struct native_thread_data_struct { struct list_node ubf_list; - rb_nativethread_cond_t sleep_cond; +#if defined(__GLIBC__) || defined(__FreeBSD__) + union +#else + /* + * assume the platform condvars are badly implemented and have a + * "memory" of which mutex they're associated with + */ + struct +#endif + { + rb_nativethread_cond_t intr; /* th->interrupt_lock */ + rb_nativethread_cond_t gvlq; /* vm->gvl.lock */ + } cond; } native_thread_data_t; #undef except -- cgit v1.2.3