]> git.kaiwu.me - nginx.git/commitdiff
Win32: improved ngx_mutex_init() stub (ticket #138).
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 2 Apr 2012 21:31:45 +0000 (21:31 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 2 Apr 2012 21:31:45 +0000 (21:31 +0000)
This allows to run nginx with "master_process off" under Windows.

src/os/win32/ngx_thread.c

index 84c9d51733baefbad0f5dcd73a7dacba3bda7031..1bdd6d2156054d59145abeac65bf6ad89c4bd460 100644 (file)
@@ -72,7 +72,18 @@ ngx_thread_set_tls(ngx_tls_key_t *key, void *data)
 ngx_mutex_t *
 ngx_mutex_init(ngx_log_t *log, ngx_uint_t flags)
 {
-    return (ngx_mutex_t *) 1;
+    ngx_mutex_t  *m;
+
+    m = ngx_alloc(sizeof(ngx_mutex_t), log);
+    if (m == NULL) {
+        return NULL;
+    }
+
+    m->log = log;
+
+    /* STUB */
+
+    return m;
 }