Mercurial > hg > nginx-quic
view src/os/unix/ngx_x86_mutex.h @ 313:98f1a8028067
nginx-0.0.3-2004-04-13-19:08:48 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 13 Apr 2004 15:08:48 +0000 |
parents | a7e45c45a95c |
children |
line wrap: on
line source
typedef struct { int lock; } ngx_mutex_t; static inline int ngx_spin_lock(ngx_mutex_t *m, int count) { int lock; __asm__ __volatile(" get_lock: mov $1, %1 xchg %1, %2 cmp $0, %1 jne spin_lock spin_lock: cmp $0, %3 je failed dec %3 rep nop cmp $0, %2 jne spin_lock ": "=q" (lock), "m" (m->lock), "q" (count)); }