+ // We only need release memory order here because of privatization safety
+ // (this ensures that marking the transaction as inactive happens after
+ // any prior data accesses by this transaction, and that neither the
+ // compiler nor the hardware order this store earlier).
+ // ??? We might be able to avoid this release here if the compiler can't
+ // merge the release fence with the subsequent seq_cst fence.
+ tx->shared_state.store (-1, memory_order_release);
+ // We need this seq_cst fence here to avoid lost wake-ups. Furthermore,
+ // the privatization safety implementation in gtm_thread::try_commit()
+ // relies on the existence of this seq_cst fence.
+ atomic_thread_fence (memory_order_seq_cst);
+ unsigned int sum = this->summary.load (memory_order_relaxed);