Removed stub implementation of win32 mutexes.

This commit is contained in:
Ruslan Ermilov 2015-03-23 13:52:47 +03:00
parent 97f8e7b93a
commit a45bb586a5
4 changed files with 0 additions and 74 deletions

View file

@ -835,8 +835,6 @@ ngx_get_connection(ngx_socket_t s, ngx_log_t *log)
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_log_t *log)
"%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_log_t *log)
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;
}

View file

@ -44,8 +44,6 @@ typedef struct ngx_http_upstream_rr_peers_s ngx_http_upstream_rr_peers_t;
struct ngx_http_upstream_rr_peers_s {
ngx_uint_t number;
/* ngx_mutex_t *mutex; */
ngx_uint_t total_weight;
unsigned single:1;

View file

@ -67,44 +67,3 @@ ngx_thread_set_tls(ngx_tls_key_t *key, void *data)
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;
}
/**/

View file

@ -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_t *key, void *data);
#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;