1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2015 Intel Corporation
5 #ifndef _RTE_RWLOCK_X86_64_H_
6 #define _RTE_RWLOCK_X86_64_H_
12 #include "generic/rte_rwlock.h"
13 #include "rte_spinlock.h"
16 rte_rwlock_read_lock_tm(rte_rwlock_t *rwl)
18 if (likely(rte_try_tm(&rwl->cnt)))
20 rte_rwlock_read_lock(rwl);
24 rte_rwlock_read_unlock_tm(rte_rwlock_t *rwl)
26 if (unlikely(rwl->cnt))
27 rte_rwlock_read_unlock(rwl);
33 rte_rwlock_write_lock_tm(rte_rwlock_t *rwl)
35 if (likely(rte_try_tm(&rwl->cnt)))
37 rte_rwlock_write_lock(rwl);
41 rte_rwlock_write_unlock_tm(rte_rwlock_t *rwl)
43 if (unlikely(rwl->cnt))
44 rte_rwlock_write_unlock(rwl);
53 #endif /* _RTE_RWLOCK_X86_64_H_ */