comparison src/os/unix/ngx_atomic.h @ 318:3021f899881a NGINX_0_5_29

nginx 0.5.29 *) Feature: $nginx_version variable. Thanks to Nick S. Grechukh. *) Bugfix: if the FastCGI header was split in records, then nginx passed garbage in the header to a client. *) Bugfix: Sun Studio compatibility on Solaris/amd64 and Solaris/sparc64. Thanks to Jiang Hong and Andrei Nigmatulin. *) Bugfix: of minor potential bugs. Thanks to Coverity's Scan.
author Igor Sysoev <http://sysoev.ru>
date Mon, 23 Jul 2007 00:00:00 +0400
parents 6eb1e38f0f1f
children
comparison
equal deleted inserted replaced
317:c012154f05d1 318:3021f899881a
85 ngx_atomic_uint_t set); 85 ngx_atomic_uint_t set);
86 86
87 ngx_atomic_int_t 87 ngx_atomic_int_t
88 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add); 88 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add);
89 89
90 /*
91 * Sun Studio 12 exits with segmentation fault on '__asm ("pause")',
92 * so ngx_cpu_pause is declared in src/os/unix/ngx_sunpro_x86.il
93 */
94
95 void
96 ngx_cpu_pause(void);
97
90 /* the code in src/os/unix/ngx_sunpro_x86.il */ 98 /* the code in src/os/unix/ngx_sunpro_x86.il */
91 99
92 #define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile") 100 #define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile")
93 #define ngx_cpu_pause() __asm ("pause")
94 101
95 102
96 #else /* ( __GNUC__ || __INTEL_COMPILER ) */ 103 #else /* ( __GNUC__ || __INTEL_COMPILER ) */
97 104
98 #define NGX_HAVE_ATOMIC_OPS 1 105 #define NGX_HAVE_ATOMIC_OPS 1
119 ngx_atomic_uint_t set); 126 ngx_atomic_uint_t set);
120 127
121 ngx_atomic_int_t 128 ngx_atomic_int_t
122 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add); 129 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add);
123 130
131 /*
132 * Sun Studio 12 exits with segmentation fault on '__asm ("pause")',
133 * so ngx_cpu_pause is declared in src/os/unix/ngx_sunpro_amd64.il
134 */
135
136 void
137 ngx_cpu_pause(void);
138
124 /* the code in src/os/unix/ngx_sunpro_amd64.il */ 139 /* the code in src/os/unix/ngx_sunpro_amd64.il */
125 140
126 #define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile") 141 #define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile")
127 #define ngx_cpu_pause() __asm ("pause")
128 142
129 143
130 #else /* ( __GNUC__ || __INTEL_COMPILER ) */ 144 #else /* ( __GNUC__ || __INTEL_COMPILER ) */
131 145
132 #define NGX_HAVE_ATOMIC_OPS 1 146 #define NGX_HAVE_ATOMIC_OPS 1
134 #include "ngx_gcc_atomic_amd64.h" 148 #include "ngx_gcc_atomic_amd64.h"
135 149
136 #endif 150 #endif
137 151
138 152
139 #elif ( __sparc__ || __sparcv9 ) 153 #elif ( __sparc__ || __sparc || __sparcv9 )
140 154
141 #if (NGX_PTR_SIZE == 8) 155 #if (NGX_PTR_SIZE == 8)
142 156
143 typedef int64_t ngx_atomic_int_t; 157 typedef int64_t ngx_atomic_int_t;
144 typedef uint64_t ngx_atomic_uint_t; 158 typedef uint64_t ngx_atomic_uint_t;