1/* 2 * Copyright 2018, Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Augustin Cavalier <waddlesplash> 7 */ 8#ifndef _FBSD_COMPAT_SYS_SX_H_ 9#define _FBSD_COMPAT_SYS_SX_H_ 10 11 12#include <lock.h> 13 14 15struct sx { 16 rw_lock l; 17}; 18 19#define sx_init(lock, name) rw_lock_init(&(lock)->l, name) 20#define sx_xlock(lock) rw_lock_write_lock(&(lock)->l) 21#define sx_xunlock(lock) rw_lock_write_unlock(&(lock)->l) 22#define sx_destroy(lock) rw_lock_destroy(&(lock)->l) 23 24#define sx_assert(sx, what) 25 26 27#endif /* _FBSD_COMPAT_SYS_SX_H_ */ 28