diff options
author | torvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-24 01:42:35 +0000 |
---|---|---|
committer | torvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-24 01:42:35 +0000 |
commit | c4c0a912745588307c7be984615a825edd421bbd (patch) | |
tree | fd0ffc4afe2a926dc6676559d466c9ae7fad9c2b /libitm/beginend.cc | |
parent | 813b307549daffa9a654d62e98a71ea8a11f932d (diff) | |
download | gcc-c4c0a912745588307c7be984615a825edd421bbd.tar.gz |
libitm: Fix privatization safety during upgrades to serial mode.
libitm/
* beginend.cc (GTM::gtm_thread::restart): Add and handle
finish_serial_upgrade parameter.
* libitm.h (GTM::gtm_thread::restart): Adapt declaration.
* config/linux/rwlock.cc (GTM::gtm_rwlock::write_lock_generic):
Don't unset reader flag.
(GTM::gtm_rwlock::write_upgrade_finish): New.
* config/posix/rwlock.cc: Same.
* config/linux/rwlock.h (GTM::gtm_rwlock::write_upgrade_finish):
Declare.
* config/posix/rwlock.h: Same.
* method-serial.cc (GTM::gtm_thread::serialirr_mode): Unset reader
flag after commit or after rollback when restarting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182675 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libitm/beginend.cc')
-rw-r--r-- | libitm/beginend.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libitm/beginend.cc b/libitm/beginend.cc index d0ad5a7fc2a..17f9d7490d8 100644 --- a/libitm/beginend.cc +++ b/libitm/beginend.cc @@ -511,11 +511,19 @@ GTM::gtm_thread::trycommit () } void ITM_NORETURN -GTM::gtm_thread::restart (gtm_restart_reason r) +GTM::gtm_thread::restart (gtm_restart_reason r, bool finish_serial_upgrade) { // Roll back to outermost transaction. Do not reset transaction state because // we will continue executing this transaction. rollback (); + + // If we have to restart while an upgrade of the serial lock is happening, + // we need to finish this here, after rollback (to ensure privatization + // safety despite undo writes) and before deciding about the retry strategy + // (which could switch to/from serial mode). + if (finish_serial_upgrade) + gtm_thread::serial_lock.write_upgrade_finish(this); + decide_retry_strategy (r); // Run dispatch-specific restart code. Retry until we succeed. |