]> git.kaiwu.me - nginx.git/commitdiff
Removed unused thread-local-storage code.
authorRuslan Ermilov <ru@nginx.com>
Thu, 26 Mar 2015 11:15:15 +0000 (14:15 +0300)
committerRuslan Ermilov <ru@nginx.com>
Thu, 26 Mar 2015 11:15:15 +0000 (14:15 +0300)
src/core/ngx_cycle.c
src/core/ngx_cycle.h
src/os/win32/ngx_process_cycle.c
src/os/win32/ngx_thread.c
src/os/win32/ngx_thread.h

index 4646978f7ba15beb9214e9e9a697204d8858bdfe..e9dfdfc2ace140ff28be8ee0e9ac393ab93e7192 100644 (file)
@@ -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;
index 28f1886cc0d9a2452bca28f7a28285dc223588cd..ba876867fe354df9ed22220c9ab38db8924d0cce 100644 (file)
@@ -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_cycles;
 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_ */
index 343528237765b47bd28092ff066de1881b30e53a..20ad5145269acc172d312452f4b5815d16a4e6a0 100644 (file)
@@ -253,7 +253,6 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
 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);
-    }
 }
 
 
index 3255e015500c7e6eb5170fcc211b1832636bb792..556ca6c9b217cf09477d9c35cd38803b6c5f4884 100644 (file)
@@ -43,27 +43,3 @@ ngx_init_threads(int n, size_t size, ngx_cycle_t *cycle)
 
     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;
-}
index e1d0a7eae986064395281dc712c5b688e3ab93e8..7d7052b2285fc16c742fe1c4d32d5f678b1f0f86 100644 (file)
@@ -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 *tid,
     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"