Commit 87baa31c authored by ryates@cs.rochester.edu's avatar ryates@cs.rochester.edu Committed by ian@well-typed.com
Browse files

Check to see if TVar's are locked in check_read_only (fixes #7815)

parent 78f9189e
......@@ -905,8 +905,12 @@ static StgBool check_read_only(StgTRecHeader *trec STG_UNUSED) {
s = e -> tvar;
if (entry_is_read_only(e)) {
TRACE("%p : check_read_only for TVar %p, saw %ld", trec, s, e -> num_updates);
if (s -> num_updates != e -> num_updates) {
// ||s -> current_value != e -> expected_value) {
// Note we need both checks and in this order as the TVar could be
// locked by another transaction that is committing but has not yet
// incremented `num_updates` (See #7815).
if (s -> current_value != e -> expected_value ||
s -> num_updates != e -> num_updates) {
TRACE("%p : mismatch", trec);
result = FALSE;
BREAK_FOR_EACH;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment