From a19db3f2e39d927e1595bbb6b9f4470c57161c7d Mon Sep 17 00:00:00 2001 From: Torvald Riegel Date: Mon, 20 Feb 2012 13:06:07 +0000 Subject: 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 --- libitm/beginend.cc | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'libitm/beginend.cc') 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); } -- cgit v1.1