2
static ngx_inline ngx_atomic_uint_t
ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
ngx_atomic_uint_t set)
{
u_char res;
__asm__ volatile (
NGX_SMP_LOCK
" cmpxchgl %3, %1; "
" sete %0; "
: "=a" (res) : "m" (*lock), "a" (old), "r" (set) : "cc", "memory");
return res;
}
我不明白的語法彙編指令組合(它使用不同的語法比printf
用途),它在幹什麼呢?
http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html – 2011-05-26 07:15:25