Mercurial > hg > nginx-quic
comparison src/os/unix/ngx_atomic.h @ 433:9a97dcdd2421
nginx-0.0.11-2004-09-21-19:47:05 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 21 Sep 2004 15:47:05 +0000 |
parents | 5e73d0ea4dab |
children | 5cdc4838d4e8 |
comparison
equal
deleted
inserted
replaced
432:11362a3e3911 | 433:9a97dcdd2421 |
---|---|
84 new = old + 1; | 84 new = old + 1; |
85 res = new; | 85 res = new; |
86 | 86 |
87 __asm__ volatile ( | 87 __asm__ volatile ( |
88 | 88 |
89 "casa [%1]ASI_P, %2, %0" | 89 "casa [%1] 0x80, %2, %0" |
90 | 90 |
91 : "+r" (res) : "r" (value), "r" (old)); | 91 : "+r" (res) : "r" (value), "r" (old)); |
92 | 92 |
93 if (res == old) { | 93 if (res == old) { |
94 return new; | 94 return new; |
110 { | 110 { |
111 uint32_t res = (uint32_t) set; | 111 uint32_t res = (uint32_t) set; |
112 | 112 |
113 __asm__ volatile ( | 113 __asm__ volatile ( |
114 | 114 |
115 "casa [%1]ASI_P, %2, %0" | 115 "casa [%1] 0x80, %2, %0" |
116 | 116 |
117 : "+r" (res) : "r" (lock), "r" (old)); | 117 : "+r" (res) : "r" (lock), "r" (old)); |
118 | 118 |
119 return (res == old); | 119 return (res == old); |
120 } | 120 } |
122 #else | 122 #else |
123 | 123 |
124 typedef volatile uint32_t ngx_atomic_t; | 124 typedef volatile uint32_t ngx_atomic_t; |
125 | 125 |
126 /* STUB */ | 126 /* STUB */ |
127 #define ngx_atomic_inc(x) (*(x))++; | 127 #define ngx_atomic_inc(x) ++(*(x)); |
128 #define ngx_atomic_dec(x) (*(x))--; | 128 #define ngx_atomic_dec(x) --(*(x)); |
129 #define ngx_atomic_cmp_set(lock, old, set) 1 | 129 #define ngx_atomic_cmp_set(lock, old, set) 1 |
130 /**/ | 130 /**/ |
131 | 131 |
132 #endif | 132 #endif |
133 | 133 |