| #ifndef _NGX_ATOMIC_H_INCLUDED_ |
| #define _NGX_ATOMIC_H_INCLUDED_ |
| #if ( __i386__ || __amd64__ ) |
| typedef volatile uint32_t ngx_atomic_t; |
| #define NGX_SMP_LOCK "lock" |
| static ngx_inline uint32_t ngx_atomic_inc(ngx_atomic_t *value) |
| : "=q" (old) : "m" (*value)); |
| static ngx_inline uint32_t ngx_atomic_dec(ngx_atomic_t *value) |
| : "=q" (old) : "m" (*value)); |
| static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock, |
| : "=a" (res) : "m" (*lock), "a" (old), "q" (set)); |
| typedef volatile uint32_t ngx_atomic_t; |
| #define ngx_atomic_inc(x) (*(x))++; |
| #define ngx_atomic_dec(x) (*(x))--; |
| #define ngx_atomic_cmp_set(lock, old, set) 1; |
| #endif /* _NGX_ATOMIC_H_INCLUDED_ */ |