From fc0bfae1da3b1338c18afd40a3ea50c350cc1907 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Sat, 13 Jul 2013 16:52:59 -0400 Subject: [PATCH] ck_elide: Commentary on ck_elide interface. --- include/ck_elide.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/ck_elide.h b/include/ck_elide.h index 79d60b5..4afd1d0 100644 --- a/include/ck_elide.h +++ b/include/ck_elide.h @@ -30,6 +30,15 @@ #include #include +/* + * Defines an elision implementation according to the following variables: + * N - Namespace of elision implementation. + * T - Typename of mutex. + * L_P - Lock predicate, returns false if resource is available. + * L - Function to call if resource is unavailable of transaction aborts. + * U_P - Unlock predicate, returns false if elision failed. + * U - Function to call if transaction failed. + */ #ifdef CK_F_PR_RTM #define CK_ELIDE_PROTOTYPE(N, T, L_P, L, U_P, U) \ CK_CC_INLINE static void \ @@ -96,6 +105,11 @@ } #endif /* CK_F_PR_RTM */ +/* + * Best-effort elision lock operations. First argument is name (N) + * associated with implementation and the second is a pointer to + * the type specified above (T). + */ #define CK_ELIDE_LOCK(NAME, LOCK) ck_elide_##NAME##_lock(LOCK) #define CK_ELIDE_UNLOCK(NAME, LOCK) ck_elide_##NAME##_unlock(LOCK) #define CK_ELIDE_TRYLOCK(NAME, LOCK) ck_elide_##NAME##_trylock(LOCK)