libitm: Fix race condition in dispatch choice at transaction begin.
authortorvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Feb 2012 13:06:07 +0000 (13:06 +0000)
committertorvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Feb 2012 13:06:07 +0000 (13:06 +0000)
commit751ab0ef43903d34d4a3d037890caa2dbb8e67dd
treeab52139ec839cdce4a63ce4b77072d1d850159b8
parent225ffc2f64e1b7c69767fb127cb8fc766bb95898
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184392 138bc75d-0d04-0410-961f-82ee72b054a4
libitm/ChangeLog
libitm/beginend.cc
libitm/retry.cc