[nginx] Removed unused thread-local-storage code.
Ruslan Ermilov
ru at nginx.com
Thu Apr 16 20:02:02 UTC 2015
details: http://hg.nginx.org/nginx/rev/16c51e80128c
branches:
changeset: 6110:16c51e80128c
user: Ruslan Ermilov <ru at nginx.com>
date: Thu Mar 26 14:15:15 2015 +0300
description:
Removed unused thread-local-storage code.
diffstat:
src/core/ngx_cycle.c | 4 ----
src/core/ngx_cycle.h | 12 ------------
src/os/win32/ngx_process_cycle.c | 9 ---------
src/os/win32/ngx_thread.c | 24 ------------------------
src/os/win32/ngx_thread.h | 7 -------
5 files changed, 0 insertions(+), 56 deletions(-)
diffs (124 lines):
diff -r d588dda5ec31 -r 16c51e80128c src/core/ngx_cycle.c
--- a/src/core/ngx_cycle.c Thu Mar 26 14:15:13 2015 +0300
+++ b/src/core/ngx_cycle.c Thu Mar 26 14:15:15 2015 +0300
@@ -26,10 +26,6 @@ static ngx_event_t ngx_cleaner_event
ngx_uint_t ngx_test_config;
ngx_uint_t ngx_quiet_mode;
-#if (NGX_OLD_THREADS)
-ngx_tls_key_t ngx_core_tls_key;
-#endif
-
/* STUB NAME */
static ngx_connection_t dumb;
diff -r d588dda5ec31 -r 16c51e80128c src/core/ngx_cycle.h
--- a/src/core/ngx_cycle.h Thu Mar 26 14:15:13 2015 +0300
+++ b/src/core/ngx_cycle.h Thu Mar 26 14:15:15 2015 +0300
@@ -112,15 +112,6 @@ typedef struct {
} 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)
@@ -141,9 +132,6 @@ extern ngx_array_t ngx_old_cy
extern ngx_module_t ngx_core_module;
extern ngx_uint_t ngx_test_config;
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_ */
diff -r d588dda5ec31 -r 16c51e80128c src/os/win32/ngx_process_cycle.c
--- a/src/os/win32/ngx_process_cycle.c Thu Mar 26 14:15:13 2015 +0300
+++ b/src/os/win32/ngx_process_cycle.c Thu Mar 26 14:15:15 2015 +0300
@@ -253,7 +253,6 @@ ngx_master_process_cycle(ngx_cycle_t *cy
static void
ngx_process_init(ngx_cycle_t *cycle)
{
- ngx_err_t err;
ngx_core_conf_t *ccf;
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 */
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);
- }
}
diff -r d588dda5ec31 -r 16c51e80128c src/os/win32/ngx_thread.c
--- a/src/os/win32/ngx_thread.c Thu Mar 26 14:15:13 2015 +0300
+++ b/src/os/win32/ngx_thread.c Thu Mar 26 14:15:15 2015 +0300
@@ -43,27 +43,3 @@ ngx_init_threads(int n, size_t size, ngx
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;
-}
diff -r d588dda5ec31 -r 16c51e80128c src/os/win32/ngx_thread.h
--- a/src/os/win32/ngx_thread.h Thu Mar 26 14:15:13 2015 +0300
+++ b/src/os/win32/ngx_thread.h Thu Mar 26 14:15:15 2015 +0300
@@ -14,7 +14,6 @@
typedef HANDLE ngx_tid_t;
-typedef DWORD ngx_tls_key_t;
typedef DWORD ngx_thread_value_t;
@@ -22,12 +21,6 @@ ngx_err_t ngx_create_thread(ngx_tid_t *t
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_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_TID_T_FMT "%ud"
More information about the nginx-devel
mailing list