diff options
author | Torvald Riegel <triegel@redhat.com> | 2016-01-16 22:08:41 +0000 |
---|---|---|
committer | Torvald Riegel <torvald@gcc.gnu.org> | 2016-01-16 22:08:41 +0000 |
commit | d2653984bf029176260b5afd80f2bec90aa040f5 (patch) | |
tree | 6344612f38b36403102234efac1277ca09d2d40b /libitm/method-ml.cc | |
parent | 197a6aa6f9d5d341d74c73bbc9714c51bf9fde70 (diff) | |
download | gcc-d2653984bf029176260b5afd80f2bec90aa040f5.zip gcc-d2653984bf029176260b5afd80f2bec90aa040f5.tar.gz gcc-d2653984bf029176260b5afd80f2bec90aa040f5.tar.bz2 |
libitm: Ensure proxy privatization safety.
* method-gl.cc (gl_wt_dispatch::trycommit): Ensure proxy privatization
safety.
* method-ml.cc (ml_wt_dispatch::trycommit): Likewise.
* libitm/testsuite/libitm.c/priv-1.c: New.
From-SVN: r232469
Diffstat (limited to 'libitm/method-ml.cc')
-rw-r--r-- | libitm/method-ml.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libitm/method-ml.cc b/libitm/method-ml.cc index 723643a..c1a6771 100644 --- a/libitm/method-ml.cc +++ b/libitm/method-ml.cc @@ -513,6 +513,21 @@ public: if (!tx->writelog.size()) { tx->readlog.clear(); + // We still need to ensure privatization safety, unfortunately. While + // we cannot have privatized anything by ourselves (because we are not + // an update transaction), we can have observed the commits of + // another update transaction that privatized something. Because any + // commit happens before ensuring privatization, our snapshot and + // commit can thus have happened before ensuring privatization safety + // for this commit/snapshot time. Therefore, before we can return to + // nontransactional code that might use the privatized data, we must + // ensure privatization safety for our snapshot time. + // This still seems to be better than not allowing use of the + // snapshot time before privatization safety has been ensured because + // we at least can run transactions such as this one, and in the + // meantime the transaction producing this commit time might have + // finished ensuring privatization safety for it. + priv_time = tx->shared_state.load(memory_order_relaxed); return true; } |