action: support ATOMIC_INIT
authorBrian Norris <banorris@uci.edu>
Sat, 7 Jul 2012 00:09:17 +0000 (17:09 -0700)
committerBrian Norris <banorris@uci.edu>
Sat, 7 Jul 2012 00:30:57 +0000 (17:30 -0700)
commitc0182a11fd62cc38f9f5cbe49960d7a9bce8d381
tree3675457a215b13327ee252d646f9eba50449a598
parent85c090982c2a8dd6e236aa8f3d0a79f974ab9603
action: support ATOMIC_INIT

For now, atomic_init() will be supported as simply a relaxed write. This
doesn't quite match the spec exactly [1, 2], but it is expedient for supporting
the common case of checking proper initialization.

[1] From C++ N3242, Section 29.6.5, Statement 8:

       Non-atomically initializes *object with value desired.

       Note: Concurrent access from another thread, even via an atomic
       operation, constitutes a data race.

[2] Note that for now, my implementation will not flag concurrent atomic_init()
    and atomic_store() as data races.
action.cc
action.h
libatomic.cc