qsbr: portability fixes: use unsigned long for the gp counters.
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Thu, 17 Sep 2009 15:11:42 +0000 (11:11 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Thu, 17 Sep 2009 15:11:42 +0000 (11:11 -0400)
commitf0f7dbdd9ba9bff3860d8aea63a3e01b158351de
tree59d407e24476d659614bd52e218a9c64252cab43
parentab179a1705ee5d662c6a7964645077980096e134
qsbr: portability fixes: use unsigned long for the gp counters.

unsigned wraps properly in C (modulo ULONG_MAX + 1), IOW ULONG_MAX + 2
_is_ defined and is 1.

Rewrite rcu_gp_ongoing test to work in the unsigned case:

    a - b < 0

becomes

    a - b > ULONG_MAX / 2

This test actually means a - b > 0x7f....f which is exactly what we want
to test for in the first place, but in a portable way.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
urcu-qsbr-static.h
urcu-qsbr.c
This page took 0.025442 seconds and 4 git commands to generate.