From 2a95df20afb5469440d1be75379c70dba8ae6abd Mon Sep 17 00:00:00 2001 From: Fyodor Kovin Date: Fri, 19 Apr 2019 14:34:54 +0200 Subject: [PATCH] ISGENQ wrapper fixes/improvements: - IS_ISGENQ_LOCK_OBTAINED macro - Workaround for a bug in the Metal headers Signed-off-by: Fyodor Kovin --- h/crossmemory.h | 1 + h/isgenq.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/h/crossmemory.h b/h/crossmemory.h index 259624ef6..eef6d1ae7 100644 --- a/h/crossmemory.h +++ b/h/crossmemory.h @@ -15,6 +15,7 @@ #ifdef METTLE #include +#include #include #else #include diff --git a/h/isgenq.h b/h/isgenq.h index 38bc6092e..67a203780 100644 --- a/h/isgenq.h +++ b/h/isgenq.h @@ -63,6 +63,9 @@ int isgenqTestLock(const QName *qname, int isgenqReleaseLock(ENQToken *token, int *reasonCode); +#define IS_ISGENQ_LOCK_OBTAINED($isgenqRC, $isgenqRSN) \ + ($isgenqRC <= 4 && ((unsigned)$isgenqRSN & 0xFFFF) != 0x0404) + #endif /* H_ISGENQ_H_ */