xref: /unit/src/nxt_spinlock.h (revision 765:7b63756a81a4)
1*0Sigor@sysoev.ru 
2*0Sigor@sysoev.ru /*
3*0Sigor@sysoev.ru  * Copyright (C) Igor Sysoev
4*0Sigor@sysoev.ru  * Copyright (C) NGINX, Inc.
5*0Sigor@sysoev.ru  */
6*0Sigor@sysoev.ru 
7*0Sigor@sysoev.ru #ifndef _NXT_UNIX_SPINLOCK_H_INCLUDED_
8*0Sigor@sysoev.ru #define _NXT_UNIX_SPINLOCK_H_INCLUDED_
9*0Sigor@sysoev.ru 
10*0Sigor@sysoev.ru 
11*0Sigor@sysoev.ru typedef nxt_atomic_t  nxt_thread_spinlock_t;
12*0Sigor@sysoev.ru 
13*0Sigor@sysoev.ru NXT_EXPORT void nxt_thread_spin_init(nxt_uint_t ncpu, nxt_uint_t count);
14*0Sigor@sysoev.ru NXT_EXPORT void nxt_thread_spin_lock(nxt_thread_spinlock_t *lock);
15*0Sigor@sysoev.ru NXT_EXPORT nxt_bool_t nxt_thread_spin_trylock(nxt_thread_spinlock_t *lock);
16*0Sigor@sysoev.ru NXT_EXPORT void nxt_thread_spin_unlock(nxt_thread_spinlock_t *lock);
17*0Sigor@sysoev.ru 
18*0Sigor@sysoev.ru 
19*0Sigor@sysoev.ru #endif /* _NXT_UNIX_SPINLOCK_H_INCLUDED_ */
20