| 109 | |
| 110 | #ifdef RTE_FORCE_INTRINSICS |
| 111 | static inline int |
| 112 | rte_spinlock_trylock(rte_spinlock_t *sl) |
| 113 | __rte_no_thread_safety_analysis |
| 114 | { |
| 115 | int exp = 0; |
| 116 | return rte_atomic_compare_exchange_strong_explicit(&sl->locked, &exp, 1, |
| 117 | rte_memory_order_acquire, rte_memory_order_relaxed); |
| 118 | } |
| 119 | #endif |
| 120 | |
| 121 | /** |