summaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-03-31 15:26:46 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-03-31 15:26:46 +0000
commit709405b7559d3abcb90b61368c7072fb774f661b (patch)
treeb6603153b1f77014711eff77d0d280d078d233cc /src/core
parenta741f8d0216d95a7ee0fbb8a24947de8842900c0 (diff)
downloadnginx-709405b7559d3abcb90b61368c7072fb774f661b.tar.gz
nginx-709405b7559d3abcb90b61368c7072fb774f661b.tar.bz2
nginx-0.0.3-2004-03-31-19:26:46 import
Diffstat (limited to 'src/core')
-rw-r--r--src/core/nginx.c4
-rw-r--r--src/core/ngx_atomic.h11
-rw-r--r--src/core/ngx_file.c2
3 files changed, 12 insertions, 5 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 8dc610240..9c35e089e 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -174,10 +174,6 @@ int main(int argc, char *const *argv)
}
}
- if (ccf->worker_processes == NGX_CONF_UNSET) {
- ccf->worker_processes = 1;
- }
-
if (ccf->pid.len == 0) {
ccf->pid.len = sizeof(NGINX_PID) - 1;
ccf->pid.data = NGINX_PID;
diff --git a/src/core/ngx_atomic.h b/src/core/ngx_atomic.h
index b95e4cc46..0ec5a8722 100644
--- a/src/core/ngx_atomic.h
+++ b/src/core/ngx_atomic.h
@@ -25,6 +25,7 @@ static ngx_inline uint32_t ngx_atomic_inc(ngx_atomic_t *value)
NGX_SMP_LOCK
" xaddl %0, %2; "
+ " incl %0; "
: "=q" (old) : "0" (1), "m" (*value));
@@ -40,6 +41,7 @@ static ngx_inline uint32_t ngx_atomic_dec(ngx_atomic_t *value)
NGX_SMP_LOCK
" xaddl %0, %1; "
+ " decl %0; "
: "=q" (old) : "0" (-1), "m" (*value));
@@ -65,6 +67,15 @@ static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
return res;
}
+
+#elif (WIN32)
+
+#define ngx_atomic_inc(x) InterlockedIncrement
+#define ngx_atomic_dec(x) InterlockedDecrement
+#define ngx_atomic_cmp_set(lock, old, set) \
+ InterlockedCompareExchange(lock, set, old)
+
+
#else
typedef volatile uint32_t ngx_atomic_t;
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c
index 48cff4624..0e9344e10 100644
--- a/src/core/ngx_file.c
+++ b/src/core/ngx_file.c
@@ -56,7 +56,7 @@ int ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path,
ngx_create_hashed_filename(file, path);
-#if 0
+#if 1
file->fd = ngx_open_tempfile(file->name.data, persistent);
#else
file->fd = ngx_open_tempfile(file->name.data, 1);