[nginx] Removed stub implementation of win32 mutexes.

Ruslan Ermilov ru at nginx.com
Mon Mar 23 10:53:46 UTC 2015


details:   http://hg.nginx.org/nginx/rev/94ce52db3367
branches:  
changeset: 6038:94ce52db3367
user:      Ruslan Ermilov <ru at nginx.com>
date:      Mon Mar 23 13:52:47 2015 +0300
description:
Removed stub implementation of win32 mutexes.

diffstat:

 src/core/ngx_connection.c                |  10 -------
 src/http/ngx_http_upstream_round_robin.h |   2 -
 src/os/win32/ngx_thread.c                |  41 --------------------------------
 src/os/win32/ngx_thread.h                |  21 ----------------
 4 files changed, 0 insertions(+), 74 deletions(-)

diffs (146 lines):

diff -r 1a9e25b3f8d1 -r 94ce52db3367 src/core/ngx_connection.c
--- a/src/core/ngx_connection.c	Mon Mar 23 02:44:41 2015 +0300
+++ b/src/core/ngx_connection.c	Mon Mar 23 13:52:47 2015 +0300
@@ -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 -r 1a9e25b3f8d1 -r 94ce52db3367 src/http/ngx_http_upstream_round_robin.h
--- a/src/http/ngx_http_upstream_round_robin.h	Mon Mar 23 02:44:41 2015 +0300
+++ b/src/http/ngx_http_upstream_round_robin.h	Mon Mar 23 13:52:47 2015 +0300
@@ -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 -r 1a9e25b3f8d1 -r 94ce52db3367 src/os/win32/ngx_thread.c
--- a/src/os/win32/ngx_thread.c	Mon Mar 23 02:44:41 2015 +0300
+++ b/src/os/win32/ngx_thread.c	Mon Mar 23 13:52:47 2015 +0300
@@ -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 -r 1a9e25b3f8d1 -r 94ce52db3367 src/os/win32/ngx_thread.h
--- a/src/os/win32/ngx_thread.h	Mon Mar 23 02:44:41 2015 +0300
+++ b/src/os/win32/ngx_thread.h	Mon Mar 23 13:52:47 2015 +0300
@@ -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;
 
 



More information about the nginx-devel mailing list