]> git.ozlabs.org Git - ccan/commit
altstack: Consolidate thread-local variables
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 3 Jun 2016 08:41:59 +0000 (18:41 +1000)
committerDan Good <dan@dancancode.com>
Thu, 16 Jun 2016 20:18:52 +0000 (20:18 +0000)
commit2da0271f9700ecb1bd402918e5f7ae7b27c2b142
tree21da4e92696e75da61dab9504e5baa6bb0a8574e
parente0b86f0ca416d757684e6d98532e1fadf839b830
altstack: Consolidate thread-local variables

altstack uses a number of __thread variables to track internal state.  This
allows altstack to be thread-safe, although it's still not re-entrant.
This patch gathers all these variables into a single per-thread state
structure.  This makes it easy to see at a glance what the whole of the
required state is, and thereby easier to reason about correctness of
changes to the implementation.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/altstack/altstack.c
ccan/altstack/test/run.c