comparison src/os/unix/ngx_thread.h @ 381:02a511569afb

nginx-0.0.7-2004-07-07-19:01:00 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 07 Jul 2004 15:01:00 +0000
parents 5ce6561246a5
children 449c4885dcd1
comparison
equal deleted inserted replaced
380:5ce6561246a5 381:02a511569afb
14 14
15 15
16 #else /* use pthreads */ 16 #else /* use pthreads */
17 17
18 #include <pthread.h> 18 #include <pthread.h>
19 #include <pthread_np.h>
20 19
21 typedef pthread_t ngx_tid_t; 20 typedef pthread_t ngx_tid_t;
22 21
23 #define ngx_thread_self() pthread_self() 22 #define ngx_thread_self() pthread_self()
24 #define ngx_log_tid (int) ngx_thread_self() 23 #define ngx_log_tid (int) ngx_thread_self()
25 24
26 #define TID_T_FMT PTR_FMT 25 #define TID_T_FMT PTR_FMT
27 26
28 27
29 #define ngx_thread_create_tls() pthread_key_create(0, NULL) 28 typedef pthread_key_t ngx_tls_key_t;
30 #define ngx_thread_create_tls_n "pthread_key_create(0, NULL)" 29
31 #define ngx_thread_get_tls() pthread_getspecific(0) 30 #define ngx_thread_key_create(key) pthread_key_create(key, NULL)
32 #define ngx_thread_set_tls(v) pthread_setspecific(0, v) 31 #define ngx_thread_key_create_n "pthread_key_create()"
32 #define ngx_thread_set_tls pthread_setspecific
33 #define ngx_thread_set_tls_n "pthread_setspecific()"
34 #define ngx_thread_get_tls pthread_getspecific
33 35
34 36
35 #define NGX_MUTEX_LIGHT 0 37 #define NGX_MUTEX_LIGHT 0
36 38
37 typedef struct { 39 typedef struct {
109 #define ngx_thread_main() 1 111 #define ngx_thread_main() 1
110 112
111 #endif 113 #endif
112 114
113 115
114 typedef struct {
115 ngx_event_t *event;
116 } ngx_tls_t;
117
118
119 116
120 #endif /* _NGX_THREAD_H_INCLUDED_ */ 117 #endif /* _NGX_THREAD_H_INCLUDED_ */