diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-13 19:11:25 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-13 19:11:25 +0000 |
commit | e27d80f7754f29f038c29ddcb2decd894d3e4aa4 (patch) | |
tree | 7506d65c4a5b0a1a5cd4450e48e4943360f9ab19 /libitm/libitm_i.h | |
parent | ef43e66cabccf0abdfb6589967043993a98a7205 (diff) | |
download | gcc-e27d80f7754f29f038c29ddcb2decd894d3e4aa4.tar.gz |
libitm: Conversion to c++11 atomics.
* local_atomic: New file.
* libitm_i.h: Include it.
(gtm_thread::shared_state): Use atomic template.
* beginend.cc (GTM::gtm_clock): Use atomic template.
(global_tid): Use atomic template if 64-bit atomics available.
(gtm_thread::gtm_thread): Update shared_state access.
(gtm_thread::trycommit): Likewise.
(choose_code_path): Update global_tid access.
* method-gl.cc (gl_mg::orec): Use atomic template. Update all users.
* stmlock.h (GTM::gtm_clock): Use atomic template.
(gtm_get_clock, gtm_inc_clock): Update accesses.
* config/linux/rwlock.cc (gtm_rwlock::read_lock): Remove
redundant __sync_synchronize after atomic shared_state access.
* config/posix/rwlock.cc (gtm_rwlock::read_lock): Likewise.
(gtm_rwlock::write_lock_generic): Likewise.
(gtm_rwlock::read_unlock): Likewise.
* config/alpha/target.h (atomic_read_barrier): Remove.
(atomic_write_barrier): Remove.
* config/x86/target.h (atomic_read_barrier): Remove.
(atomic_write_barrier): Remove.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182294 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libitm/libitm_i.h')
-rw-r--r-- | libitm/libitm_i.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libitm/libitm_i.h b/libitm/libitm_i.h index ff6884e8805..d57872ede7b 100644 --- a/libitm/libitm_i.h +++ b/libitm/libitm_i.h @@ -37,6 +37,7 @@ #include <string.h> #include <unwind.h> #include "local_type_traits" +#include "local_atomic" #include "common.h" @@ -206,7 +207,7 @@ struct gtm_thread // If this transaction is inactive, shared_state is ~0. Otherwise, this is // an active or serial transaction. - gtm_word shared_state; + atomic<gtm_word> shared_state; // The lock that provides access to serial mode. Non-serialized // transactions acquire read locks; a serialized transaction aquires |