From a51c8c7aa6dc9229a53ad30f08c912c3a617bc53 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Fri, 12 Jul 2013 19:14:39 -0400 Subject: [PATCH] ck_spinlock: Add ck_spinlock_clh_locked. --- include/ck_spinlock.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/ck_spinlock.h b/include/ck_spinlock.h index aecb91b..ce7c069 100644 --- a/include/ck_spinlock.h +++ b/include/ck_spinlock.h @@ -802,6 +802,17 @@ ck_spinlock_clh_init(struct ck_spinlock_clh **lock, struct ck_spinlock_clh *unow return; } +CK_CC_INLINE static bool +ck_spinlock_clh_locked(struct ck_spinlock_clh **queue) +{ + struct ck_spinlock_clh *head; + + ck_pr_fence_load(); + head = ck_pr_load_ptr(queue); + ck_pr_fence_load(); + return ck_pr_load_uint(&head->wait); +} + CK_CC_INLINE static void ck_spinlock_clh_lock(struct ck_spinlock_clh **queue, struct ck_spinlock_clh *thread) {