Mercurial > hg > nginx
comparison src/core/ngx_atomic.h @ 302:1526e7686b20
nginx-0.0.3-2004-04-01-10:21:13 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 01 Apr 2004 06:21:13 +0000 |
parents | 744965ec6275 |
children | 54f76b0b8dca |
comparison
equal
deleted
inserted
replaced
301:744965ec6275 | 302:1526e7686b20 |
---|---|
68 } | 68 } |
69 | 69 |
70 | 70 |
71 #elif (WIN32) | 71 #elif (WIN32) |
72 | 72 |
73 #define ngx_atomic_inc(x) InterlockedIncrement | 73 #define ngx_atomic_inc(p) InterlockedIncrement((long *) p) |
74 #define ngx_atomic_dec(x) InterlockedDecrement | 74 #define ngx_atomic_dec(p) InterlockedDecrement((long *) p) |
75 /* STUB */ | |
76 #define ngx_atomic_cmp_set(lock, old, set) 1 | |
77 #if 0 | |
75 #define ngx_atomic_cmp_set(lock, old, set) \ | 78 #define ngx_atomic_cmp_set(lock, old, set) \ |
76 InterlockedCompareExchange(lock, set, old) | 79 InterlockedCompareExchange(lock, set, old) |
80 #endif | |
77 | 81 |
78 | 82 |
79 #else | 83 #else |
80 | 84 |
81 typedef volatile uint32_t ngx_atomic_t; | 85 typedef volatile uint32_t ngx_atomic_t; |
82 | 86 |
83 /* STUB */ | 87 /* STUB */ |
84 #define ngx_atomic_inc(x) (*(x))++; | 88 #define ngx_atomic_inc(x) (*(x))++; |
85 #define ngx_atomic_dec(x) (*(x))--; | 89 #define ngx_atomic_dec(x) (*(x))--; |
86 #define ngx_atomic_cmp_set(lock, old, set) 1; | 90 #define ngx_atomic_cmp_set(lock, old, set) 1 |
87 /**/ | 91 /**/ |
88 | 92 |
89 #endif | 93 #endif |
90 | 94 |
91 | 95 |