mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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
This commit is contained in:
parent
c307ffe64f
commit
a038bf238b
2 changed files with 30 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue