comparison src/core/ngx_connection.c @ 6038:94ce52db3367

Removed stub implementation of win32 mutexes.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 23 Mar 2015 13:52:47 +0300
parents c8acea7c7041
children 4dc8e7b62216
comparison
equal deleted inserted replaced
6037:1a9e25b3f8d1 6038:94ce52db3367
833 "but only %ui files are available", 833 "but only %ui files are available",
834 s, ngx_cycle->files_n); 834 s, ngx_cycle->files_n);
835 return NULL; 835 return NULL;
836 } 836 }
837 837
838 /* ngx_mutex_lock */
839
840 c = ngx_cycle->free_connections; 838 c = ngx_cycle->free_connections;
841 839
842 if (c == NULL) { 840 if (c == NULL) {
843 ngx_drain_connections(); 841 ngx_drain_connections();
844 c = ngx_cycle->free_connections; 842 c = ngx_cycle->free_connections;
847 if (c == NULL) { 845 if (c == NULL) {
848 ngx_log_error(NGX_LOG_ALERT, log, 0, 846 ngx_log_error(NGX_LOG_ALERT, log, 0,
849 "%ui worker_connections are not enough", 847 "%ui worker_connections are not enough",
850 ngx_cycle->connection_n); 848 ngx_cycle->connection_n);
851 849
852 /* ngx_mutex_unlock */
853
854 return NULL; 850 return NULL;
855 } 851 }
856 852
857 ngx_cycle->free_connections = c->data; 853 ngx_cycle->free_connections = c->data;
858 ngx_cycle->free_connection_n--; 854 ngx_cycle->free_connection_n--;
859
860 /* ngx_mutex_unlock */
861 855
862 if (ngx_cycle->files) { 856 if (ngx_cycle->files) {
863 ngx_cycle->files[s] = c; 857 ngx_cycle->files[s] = c;
864 } 858 }
865 859
894 888
895 889
896 void 890 void
897 ngx_free_connection(ngx_connection_t *c) 891 ngx_free_connection(ngx_connection_t *c)
898 { 892 {
899 /* ngx_mutex_lock */
900
901 c->data = ngx_cycle->free_connections; 893 c->data = ngx_cycle->free_connections;
902 ngx_cycle->free_connections = c; 894 ngx_cycle->free_connections = c;
903 ngx_cycle->free_connection_n++; 895 ngx_cycle->free_connection_n++;
904
905 /* ngx_mutex_unlock */
906 896
907 if (ngx_cycle->files) { 897 if (ngx_cycle->files) {
908 ngx_cycle->files[c->fd] = NULL; 898 ngx_cycle->files[c->fd] = NULL;
909 } 899 }
910 } 900 }