1 #ifndef __XFS_SUPPORT_MUTEX_H__
2 #define __XFS_SUPPORT_MUTEX_H__
10 * Map the mutex'es from IRIX to FreeBSD. Irix holds mutexes across
11 * sleeps, so on FreeBSD we have a choice of sema, sx or lockmgr
12 * to use as a underlining implemenation. Go with sx always locked
13 * in exclusive mode for now as it gets all the benefits of witness
16 typedef struct sx mutex_t;
18 #define mutex_init(lock, type, name) sx_init(lock, name)
19 #define mutex_lock(lock, num) sx_xlock(lock)
20 #define mutex_trylock(lock) sx_try_xlock(lock)
21 #define mutex_unlock(lock) sx_xunlock(lock)
22 #define mutex_destroy(lock) sx_destroy(lock)
25 * Type for mutex_init()
27 #define MUTEX_DEFAULT 0
29 #endif /* __XFS_SUPPORT_MUTEX_H__ */