projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
urcu-qsbr: move offline threads to separate list
[urcu.git]
/
urcu
/
static
/
urcu-qsbr.h
diff --git
a/urcu/static/urcu-qsbr.h
b/urcu/static/urcu-qsbr.h
index f3149569b2a2e2573df57936673d82eaadf0e1d7..f6e55807db267ba66227f1d7046511f56589aa76 100644
(file)
--- a/
urcu/static/urcu-qsbr.h
+++ b/
urcu/static/urcu-qsbr.h
@@
-62,6
+62,12
@@
extern "C" {
#define rcu_assert(args...)
#endif
#define rcu_assert(args...)
#endif
+enum rcu_state {
+ RCU_READER_ACTIVE_CURRENT,
+ RCU_READER_ACTIVE_OLD,
+ RCU_READER_INACTIVE,
+};
+
#ifdef DEBUG_YIELD
#include <sched.h>
#include <time.h>
#ifdef DEBUG_YIELD
#include <sched.h>
#include <time.h>
@@
-149,12
+155,16
@@
static inline void wake_up_gp(void)
}
}
}
}
-static inline
int rcu_gp_ongoing
(unsigned long *ctr)
+static inline
enum rcu_state rcu_reader_state
(unsigned long *ctr)
{
unsigned long v;
v = CMM_LOAD_SHARED(*ctr);
{
unsigned long v;
v = CMM_LOAD_SHARED(*ctr);
- return v && (v != rcu_gp_ctr);
+ if (!v)
+ return RCU_READER_INACTIVE;
+ if (v == rcu_gp_ctr)
+ return RCU_READER_ACTIVE_CURRENT;
+ return RCU_READER_ACTIVE_OLD;
}
/*
}
/*
This page took
0.02349 seconds
and
4
git commands to generate.