projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
qsbr: portability fixes: use unsigned long for the gp counters.
[urcu.git]
/
urcu-qsbr-static.h
diff --git
a/urcu-qsbr-static.h
b/urcu-qsbr-static.h
index 8d8aa3f8f60519620dbcfb78aef1b007c6183e5c..3d2ec8f3af5b046c9ca66c3b24e4e77aa762d358 100644
(file)
--- a/
urcu-qsbr-static.h
+++ b/
urcu-qsbr-static.h
@@
-32,6
+32,7
@@
#include <stdlib.h>
#include <pthread.h>
#include <assert.h>
#include <stdlib.h>
#include <pthread.h>
#include <assert.h>
+#include <limits.h>
#include <compiler.h>
#include <arch.h>
#include <compiler.h>
#include <arch.h>
@@
-165,18
+166,18
@@
static inline void reader_barrier()
* Using a int rather than a char to eliminate false register dependencies
* causing stalls on some architectures.
*/
* Using a int rather than a char to eliminate false register dependencies
* causing stalls on some architectures.
*/
-extern long urcu_gp_ctr;
+extern
unsigned
long urcu_gp_ctr;
-extern long __thread rcu_reader_qs_gp;
+extern
unsigned
long __thread rcu_reader_qs_gp;
-static inline int rcu_gp_ongoing(long *value)
+static inline int rcu_gp_ongoing(
unsigned
long *value)
{
{
- long reader_gp;
+
unsigned
long reader_gp;
if (value == NULL)
return 0;
reader_gp = LOAD_SHARED(*value);
if (value == NULL)
return 0;
reader_gp = LOAD_SHARED(*value);
- return reader_gp && (reader_gp - urcu_gp_ctr
< 0
);
+ return reader_gp && (reader_gp - urcu_gp_ctr
> ULONG_MAX / 2
);
}
static inline void _rcu_read_lock(void)
}
static inline void _rcu_read_lock(void)
This page took
0.023815 seconds
and
4
git commands to generate.