mirror of
https://github.com/nginx/nginx.git
synced 2025-08-06 14:56:15 +08:00
Removed unused thread-local-storage code.
This commit is contained in:
parent
2b0d2f0583
commit
324e389e17
@ -26,10 +26,6 @@ static ngx_event_t ngx_cleaner_event;
|
|||||||
ngx_uint_t ngx_test_config;
|
ngx_uint_t ngx_test_config;
|
||||||
ngx_uint_t ngx_quiet_mode;
|
ngx_uint_t ngx_quiet_mode;
|
||||||
|
|
||||||
#if (NGX_OLD_THREADS)
|
|
||||||
ngx_tls_key_t ngx_core_tls_key;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* STUB NAME */
|
/* STUB NAME */
|
||||||
static ngx_connection_t dumb;
|
static ngx_connection_t dumb;
|
||||||
|
@ -112,15 +112,6 @@ typedef struct {
|
|||||||
} ngx_core_conf_t;
|
} ngx_core_conf_t;
|
||||||
|
|
||||||
|
|
||||||
#if (NGX_OLD_THREADS)
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
ngx_pool_t *pool; /* pcre's malloc() pool */
|
|
||||||
} ngx_core_tls_t;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define ngx_is_init_cycle(cycle) (cycle->conf_ctx == NULL)
|
#define ngx_is_init_cycle(cycle) (cycle->conf_ctx == NULL)
|
||||||
|
|
||||||
|
|
||||||
@ -141,9 +132,6 @@ extern ngx_array_t ngx_old_cycles;
|
|||||||
extern ngx_module_t ngx_core_module;
|
extern ngx_module_t ngx_core_module;
|
||||||
extern ngx_uint_t ngx_test_config;
|
extern ngx_uint_t ngx_test_config;
|
||||||
extern ngx_uint_t ngx_quiet_mode;
|
extern ngx_uint_t ngx_quiet_mode;
|
||||||
#if (NGX_OLD_THREADS)
|
|
||||||
extern ngx_tls_key_t ngx_core_tls_key;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* _NGX_CYCLE_H_INCLUDED_ */
|
#endif /* _NGX_CYCLE_H_INCLUDED_ */
|
||||||
|
@ -253,7 +253,6 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
|
|||||||
static void
|
static void
|
||||||
ngx_process_init(ngx_cycle_t *cycle)
|
ngx_process_init(ngx_cycle_t *cycle)
|
||||||
{
|
{
|
||||||
ngx_err_t err;
|
|
||||||
ngx_core_conf_t *ccf;
|
ngx_core_conf_t *ccf;
|
||||||
|
|
||||||
ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
|
ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
|
||||||
@ -264,14 +263,6 @@ ngx_process_init(ngx_cycle_t *cycle)
|
|||||||
/* fatal */
|
/* fatal */
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ngx_thread_key_create(&ngx_core_tls_key);
|
|
||||||
if (err != 0) {
|
|
||||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
|
|
||||||
ngx_thread_key_create_n " failed");
|
|
||||||
/* fatal */
|
|
||||||
exit(2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,27 +43,3 @@ ngx_init_threads(int n, size_t size, ngx_cycle_t *cycle)
|
|||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ngx_err_t
|
|
||||||
ngx_thread_key_create(ngx_tls_key_t *key)
|
|
||||||
{
|
|
||||||
*key = TlsAlloc();
|
|
||||||
|
|
||||||
if (*key == TLS_OUT_OF_INDEXES) {
|
|
||||||
return ngx_errno;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ngx_err_t
|
|
||||||
ngx_thread_set_tls(ngx_tls_key_t *key, void *data)
|
|
||||||
{
|
|
||||||
if (TlsSetValue(*key, data) == 0) {
|
|
||||||
return ngx_errno;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
|
|
||||||
typedef HANDLE ngx_tid_t;
|
typedef HANDLE ngx_tid_t;
|
||||||
typedef DWORD ngx_tls_key_t;
|
|
||||||
typedef DWORD ngx_thread_value_t;
|
typedef DWORD ngx_thread_value_t;
|
||||||
|
|
||||||
|
|
||||||
@ -22,12 +21,6 @@ ngx_err_t ngx_create_thread(ngx_tid_t *tid,
|
|||||||
ngx_thread_value_t (__stdcall *func)(void *arg), void *arg, ngx_log_t *log);
|
ngx_thread_value_t (__stdcall *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_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_log_tid GetCurrentThreadId()
|
#define ngx_log_tid GetCurrentThreadId()
|
||||||
#define NGX_TID_T_FMT "%ud"
|
#define NGX_TID_T_FMT "%ud"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user