Mercurial > hg > nginx
comparison src/core/ngx_atomic.h @ 370:54f76b0b8dca
nginx-0.0.7-2004-06-27-22:01:57 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 27 Jun 2004 18:01:57 +0000 |
parents | 1526e7686b20 |
children | 780e93985b93 |
comparison
equal
deleted
inserted
replaced
369:9c2515d70489 | 370:54f76b0b8dca |
---|---|
91 /**/ | 91 /**/ |
92 | 92 |
93 #endif | 93 #endif |
94 | 94 |
95 | 95 |
96 static ngx_inline ngx_int_t ngx_trylock(ngx_atomic_t *lock) | |
97 { | |
98 if (*lock) { | |
99 return NGX_BUSY; | |
100 } | |
101 | |
102 if (ngx_atomic_cmp_set(lock, 0, 1)) { | |
103 return NGX_OK; | |
104 } | |
105 | |
106 return NGX_BUSY; | |
107 } | |
108 | |
109 | |
96 #endif /* _NGX_ATOMIC_H_INCLUDED_ */ | 110 #endif /* _NGX_ATOMIC_H_INCLUDED_ */ |