Mercurial > hg > nginx-quic
annotate src/os/win32/ngx_thread.h @ 5739:6e4bb1d6679d
Configure: style.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 26 Jun 2014 03:34:02 +0400 |
parents | d620f497c50f |
children | 94ce52db3367 |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
4412 | 4 * Copyright (C) Nginx, Inc. |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
5 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
6 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
7 |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 #ifndef _NGX_THREAD_H_INCLUDED_ |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 #define _NGX_THREAD_H_INCLUDED_ |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 #include <ngx_config.h> |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
13 #include <ngx_core.h> |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
14 |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
15 |
461 | 16 typedef HANDLE ngx_tid_t; |
17 typedef DWORD ngx_tls_key_t; | |
563 | 18 typedef DWORD ngx_thread_value_t; |
461 | 19 |
20 | |
21 typedef struct { | |
22 HANDLE mutex; | |
23 ngx_log_t *log; | |
24 } ngx_mutex_t; | |
25 | |
26 | |
563 | 27 ngx_err_t ngx_create_thread(ngx_tid_t *tid, |
28 ngx_thread_value_t (__stdcall *func)(void *arg), void *arg, ngx_log_t *log); | |
461 | 29 ngx_int_t ngx_init_threads(int n, size_t size, ngx_cycle_t *cycle); |
30 | |
31 ngx_err_t ngx_thread_key_create(ngx_tls_key_t *key); | |
32 #define ngx_thread_key_create_n "TlsAlloc()" | |
33 ngx_err_t ngx_thread_set_tls(ngx_tls_key_t *key, void *data); | |
34 #define ngx_thread_set_tls_n "TlsSetValue()" | |
35 #define ngx_thread_get_tls TlsGetValue | |
36 | |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
37 |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
38 #define ngx_thread_volatile volatile |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
39 |
461 | 40 #define ngx_log_tid GetCurrentThreadId() |
41 #define NGX_TID_T_FMT "%ud" | |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
42 |
461 | 43 |
44 ngx_mutex_t *ngx_mutex_init(ngx_log_t *log, ngx_uint_t flags); | |
45 | |
563 | 46 void ngx_mutex_lock(ngx_mutex_t *m); |
501 | 47 ngx_int_t ngx_mutex_trylock(ngx_mutex_t *m); |
563 | 48 void ngx_mutex_unlock(ngx_mutex_t *m); |
501 | 49 |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
50 |
461 | 51 /* STUB */ |
52 #define NGX_MUTEX_LIGHT 0 | |
501 | 53 /**/ |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
54 |
461 | 55 |
56 extern ngx_int_t ngx_threads_n; | |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
57 |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
58 |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
59 #endif /* _NGX_THREAD_H_INCLUDED_ */ |