Ruby  1.9.3p448(2013-06-27revision41675)
thread_pthread.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  thread_pthread.h -
4 
5  $Author: kosaki $
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 #include <pthread.h>
15 #ifdef HAVE_PTHREAD_NP_H
16 #include <pthread_np.h>
17 #endif
18 typedef pthread_t rb_thread_id_t;
19 typedef pthread_mutex_t rb_thread_lock_t;
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 {
32 
33 #include <semaphore.h>
34 
35 typedef struct rb_global_vm_lock_struct {
36  /* fast path */
37  unsigned long acquired;
38  pthread_mutex_t lock;
39 
40  /* slow path */
41  volatile unsigned long waiting;
43 
44  /* yield */
50 
51 #endif /* RUBY_THREAD_PTHREAD_H */
52