diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-30 09:54:41 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-30 09:54:41 +0000 |
commit | a038bf238bd9a24bf1e1622f618a27db261fc91b (patch) | |
tree | e548519df847c3b669d4737efb28d5c72f76c964 /thread_pthread.h | |
parent | c307ffe64fce194a3d9ac6bbf1eacd29acb06745 (diff) |
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
Diffstat (limited to 'thread_pthread.h')
-rw-r--r-- | thread_pthread.h | 14 |
1 files changed, 13 insertions, 1 deletions
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 |