-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2013 Free Software Foundation, Inc.
Contributed by Torvald Riegel <triegel@redhat.com>.
This file is part of the GNU Transactional Memory Library (libitm).
void write_unlock ();
bool write_upgrade (gtm_thread *tx);
+ void write_upgrade_finish (gtm_thread *tx);
+
+ // Returns true iff there is a concurrent active or waiting writer.
+ // This is primarily useful for simple HyTM approaches, and the value being
+ // checked is loaded with memory_order_relaxed.
+ bool is_write_locked()
+ {
+ return writers.load (memory_order_relaxed) != 0;
+ }
protected:
bool write_lock_generic (gtm_thread *tx);