Commit ab9dd2b7 authored by Linus Torvalds's avatar Linus Torvalds

x86-64: rwlock *_can_lock() primitives

parent f860771f
...@@ -159,6 +159,9 @@ typedef struct { ...@@ -159,6 +159,9 @@ typedef struct {
#define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while(0) #define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while(0)
#define read_can_lock(x) ((int)(x)->lock > 0)
#define write_can_lock(x) ((x)->lock == RW_LOCK_BIAS)
/* /*
* On x86, we implement read-write locks as a 32-bit counter * On x86, we implement read-write locks as a 32-bit counter
* with the high bit (sign) being the "contended" bit. * with the high bit (sign) being the "contended" bit.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment