Use xor rather than 1 - x pattern to get prior period
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Oct 2022 17:55:55 +0000 (13:55 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Oct 2022 17:55:55 +0000 (13:55 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/rcu.h

index 74026b439d3df1e77a4bfc7d391ba0185c765c04..2831294b546bb4e8edaae0e9ea850146c54a57ff 100644 (file)
--- a/src/rcu.h
+++ b/src/rcu.h
@@ -72,7 +72,7 @@ void side_rcu_read_end(struct side_rcu_gp_state *gp_state, unsigned int period)
 static inline
 void wait_for_cpus(struct side_rcu_gp_state *gp_state)
 {
-       unsigned int prev_period = 1 - gp_state->period;
+       unsigned int prev_period = gp_state->period ^ 1;
 
        /*
         * Wait for the sum of CPU begin/end counts to match for the
This page took 0.024483 seconds and 4 git commands to generate.