Ruby  2.5.0dev(2017-10-22revision60238)
thread_pthread.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  thread_pthread.h -
4 
5  $Author$
6 
7  Copyright (C) 2004-2007 Koichi Sasada
8 
9 **********************************************************************/
10 
11 #ifndef RUBY_THREAD_PTHREAD_H
12 #define RUBY_THREAD_PTHREAD_H
13 
14 #ifdef HAVE_PTHREAD_NP_H
15 #include <pthread_np.h>
16 #endif
17 
18 #define RB_NATIVETHREAD_LOCK_INIT PTHREAD_MUTEX_INITIALIZER
19 #define RB_NATIVETHREAD_COND_INIT { PTHREAD_COND_INITIALIZER, }
20 
21 typedef struct rb_thread_cond_struct {
22  pthread_cond_t cond;
23 #ifdef HAVE_CLOCKID_T
24  clockid_t clockid;
25 #endif
27 
28 typedef struct native_thread_data_struct {
29  struct list_node ubf_list;
32 
33 #undef except
34 #undef try
35 #undef leave
36 #undef finally
37 
38 typedef struct rb_global_vm_lock_struct {
39  /* fast path */
40  unsigned long acquired;
41  rb_nativethread_lock_t lock;
42 
43  /* slow path */
44  volatile unsigned long waiting;
46 
47  /* yield */
53 
54 #endif /* RUBY_THREAD_PTHREAD_H */
rb_nativethread_cond_t sleep_cond
volatile unsigned long waiting
struct rb_thread_cond_struct rb_nativethread_cond_t
rb_nativethread_cond_t switch_cond
int clockid_t
Definition: win32.h:132
struct native_thread_data_struct native_thread_data_t
rb_nativethread_cond_t cond
rb_nativethread_lock_t lock
rb_nativethread_cond_t switch_wait_cond
pthread_cond_t cond
struct rb_global_vm_lock_struct rb_global_vm_lock_t