blob: 5b3c4da98f85798be0e4556d5d01b2d3dbf29ac0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/*
* Copyright (C) Igor Sysoev
*/
#ifndef _NGX_THREAD_H_INCLUDED_
#define _NGX_THREAD_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
typedef HANDLE ngx_tid_t;
typedef DWORD ngx_tls_key_t;
typedef struct {
HANDLE mutex;
ngx_log_t *log;
} ngx_mutex_t;
ngx_err_t ngx_create_thread(ngx_tid_t *tid, void* (*func)(void *arg), void *arg,
ngx_log_t *log);
ngx_int_t ngx_init_threads(int n, size_t size, ngx_cycle_t *cycle);
ngx_err_t ngx_thread_key_create(ngx_tls_key_t *key);
#define ngx_thread_key_create_n "TlsAlloc()"
ngx_err_t ngx_thread_set_tls(ngx_tls_key_t *key, void *data);
#define ngx_thread_set_tls_n "TlsSetValue()"
#define ngx_thread_get_tls TlsGetValue
#define ngx_thread_volatile volatile
#define ngx_log_tid GetCurrentThreadId()
#define NGX_TID_T_FMT "%ud"
ngx_mutex_t *ngx_mutex_init(ngx_log_t *log, ngx_uint_t flags);
/* STUB */
#define NGX_MUTEX_LIGHT 0
#define ngx_mutex_lock(m) NGX_OK
#define ngx_mutex_trylock(m) NGX_OK
#define ngx_mutex_unlock(m)
/* */
extern ngx_int_t ngx_threads_n;
#endif /* _NGX_THREAD_H_INCLUDED_ */
|