diff options
author | Torvald Riegel <triegel@redhat.com> | 2012-02-20 13:06:07 +0000 |
---|---|---|
committer | Torvald Riegel <torvald@gcc.gnu.org> | 2012-02-20 13:06:07 +0000 |
commit | a19db3f2e39d927e1595bbb6b9f4470c57161c7d (patch) | |
tree | ab52139ec839cdce4a63ce4b77072d1d850159b8 /libitm/beginend.cc | |
parent | 5a226e0af1d34600e38f02e3e84485db3f96b56c (diff) | |
download | gcc-a19db3f2e39d927e1595bbb6b9f4470c57161c7d.zip gcc-a19db3f2e39d927e1595bbb6b9f4470c57161c7d.tar.gz gcc-a19db3f2e39d927e1595bbb6b9f4470c57161c7d.tar.bz2 |
libitm: Fix race condition in dispatch choice at transaction begin.
libitm/
* beginend.cc (GTM::gtm_thread::begin_transaction): Move serial lock
acquisition to ...
* retry.cc (GTM::gtm_thread::decide_begin_dispatch): ... here.
(default_dispatch): Make atomic.
(GTM::gtm_thread::set_default_dispatch): Access atomically.
(GTM::gtm_thread::decide_retry_strategy): Access atomically and
use decide_begin_dispatch() if default_dispatch might have changed.
(GTM::gtm_thread::number_of_threads_changed): Initialize
default_dispatch here.
From-SVN: r184392
Diffstat (limited to 'libitm/beginend.cc')
-rw-r--r-- | libitm/beginend.cc | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/libitm/beginend.cc b/libitm/beginend.cc index 08c2174..e6a84de 100644 --- a/libitm/beginend.cc +++ b/libitm/beginend.cc @@ -233,16 +233,6 @@ GTM::gtm_thread::begin_transaction (uint32_t prop, const gtm_jmpbuf *jb) { // Outermost transaction disp = tx->decide_begin_dispatch (prop); - if (disp == dispatch_serialirr() || disp == dispatch_serial()) - { - tx->state = STATE_SERIAL; - if (disp == dispatch_serialirr()) - tx->state |= STATE_IRREVOCABLE; - serial_lock.write_lock (); - } - else - serial_lock.read_lock (tx); - set_abi_disp (disp); } |