projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify qsbr online condition
[urcu.git]
/
urcu-qsbr-static.h
diff --git
a/urcu-qsbr-static.h
b/urcu-qsbr-static.h
index 7cef820d59fd7ff4223b0a9cc01f6834073d7b13..125301f9b7749c4a93784068eb3f6e320aa156d9 100644
(file)
--- a/
urcu-qsbr-static.h
+++ b/
urcu-qsbr-static.h
@@
-135,7
+135,7
@@
struct rcu_reader {
/* Data used by both reader and synchronize_rcu() */
unsigned long ctr;
/* Data used for registry */
/* Data used by both reader and synchronize_rcu() */
unsigned long ctr;
/* Data used for registry */
- struct list_head
head
__attribute__((aligned(CACHE_LINE_SIZE)));
+ struct list_head
node
__attribute__((aligned(CACHE_LINE_SIZE)));
pthread_t tid;
};
pthread_t tid;
};
@@
-156,24
+156,20
@@
static inline void wake_up_gp(void)
}
#if (BITS_PER_LONG < 64)
}
#if (BITS_PER_LONG < 64)
-static inline int rcu_gp_ongoing(unsigned long *
value
)
+static inline int rcu_gp_ongoing(unsigned long *
ctr
)
{
{
- unsigned long
reader_gp
;
+ unsigned long
v
;
- if (value == NULL)
- return 0;
- reader_gp = LOAD_SHARED(*value);
- return reader_gp && ((reader_gp ^ rcu_gp_ctr) & RCU_GP_CTR);
+ v = LOAD_SHARED(*ctr);
+ return v && ((v ^ rcu_gp_ctr) & RCU_GP_CTR);
}
#else /* !(BITS_PER_LONG < 64) */
}
#else /* !(BITS_PER_LONG < 64) */
-static inline int rcu_gp_ongoing(unsigned long *
value
)
+static inline int rcu_gp_ongoing(unsigned long *
ctr
)
{
{
- unsigned long
reader_gp
;
+ unsigned long
v
;
- if (value == NULL)
- return 0;
- reader_gp = LOAD_SHARED(*value);
- return reader_gp && (reader_gp - rcu_gp_ctr > ULONG_MAX / 2);
+ v = LOAD_SHARED(*ctr);
+ return v && (v != rcu_gp_ctr);
}
#endif /* !(BITS_PER_LONG < 64) */
}
#endif /* !(BITS_PER_LONG < 64) */
This page took
0.022751 seconds
and
4
git commands to generate.