# HG changeset patch # User Ruslan Ermilov # Date 1427107967 -10800 # Node ID 94ce52db33678ab1601cf584c6f1a7a8bf17aee3 # Parent 1a9e25b3f8d1f72db8f160b3aedf8e535a79580d Removed stub implementation of win32 mutexes. diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -835,8 +835,6 @@ ngx_get_connection(ngx_socket_t s, ngx_l return NULL; } - /* ngx_mutex_lock */ - c = ngx_cycle->free_connections; if (c == NULL) { @@ -849,16 +847,12 @@ ngx_get_connection(ngx_socket_t s, ngx_l "%ui worker_connections are not enough", ngx_cycle->connection_n); - /* ngx_mutex_unlock */ - return NULL; } ngx_cycle->free_connections = c->data; ngx_cycle->free_connection_n--; - /* ngx_mutex_unlock */ - if (ngx_cycle->files) { ngx_cycle->files[s] = c; } @@ -896,14 +890,10 @@ ngx_get_connection(ngx_socket_t s, ngx_l void ngx_free_connection(ngx_connection_t *c) { - /* ngx_mutex_lock */ - c->data = ngx_cycle->free_connections; ngx_cycle->free_connections = c; ngx_cycle->free_connection_n++; - /* ngx_mutex_unlock */ - if (ngx_cycle->files) { ngx_cycle->files[c->fd] = NULL; } diff --git a/src/http/ngx_http_upstream_round_robin.h b/src/http/ngx_http_upstream_round_robin.h --- a/src/http/ngx_http_upstream_round_robin.h +++ b/src/http/ngx_http_upstream_round_robin.h @@ -44,8 +44,6 @@ typedef struct ngx_http_upstream_rr_peer struct ngx_http_upstream_rr_peers_s { ngx_uint_t number; - /* ngx_mutex_t *mutex; */ - ngx_uint_t total_weight; unsigned single:1; diff --git a/src/os/win32/ngx_thread.c b/src/os/win32/ngx_thread.c --- a/src/os/win32/ngx_thread.c +++ b/src/os/win32/ngx_thread.c @@ -67,44 +67,3 @@ ngx_thread_set_tls(ngx_tls_key_t *key, v return 0; } - - -ngx_mutex_t * -ngx_mutex_init(ngx_log_t *log, ngx_uint_t flags) -{ - ngx_mutex_t *m; - - m = ngx_alloc(sizeof(ngx_mutex_t), log); - if (m == NULL) { - return NULL; - } - - m->log = log; - - /* STUB */ - - return m; -} - - -/* STUB */ - -void -ngx_mutex_lock(ngx_mutex_t *m) { - return; -} - - - -ngx_int_t -ngx_mutex_trylock(ngx_mutex_t *m) { - return NGX_OK; -} - - -void -ngx_mutex_unlock(ngx_mutex_t *m) { - return; -} - -/**/ diff --git a/src/os/win32/ngx_thread.h b/src/os/win32/ngx_thread.h --- a/src/os/win32/ngx_thread.h +++ b/src/os/win32/ngx_thread.h @@ -18,12 +18,6 @@ typedef DWORD ngx_tls_key_t; typedef DWORD ngx_thread_value_t; -typedef struct { - HANDLE mutex; - ngx_log_t *log; -} ngx_mutex_t; - - 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); @@ -34,25 +28,10 @@ ngx_err_t ngx_thread_set_tls(ngx_tls_key #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); - -void ngx_mutex_lock(ngx_mutex_t *m); -ngx_int_t ngx_mutex_trylock(ngx_mutex_t *m); -void ngx_mutex_unlock(ngx_mutex_t *m); - - -/* STUB */ -#define NGX_MUTEX_LIGHT 0 -/**/ - - extern ngx_int_t ngx_threads_n;