Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Kaznacheev
GHC
Commits
d71d1973
Commit
d71d1973
authored
12 years ago
by
Ian Lynagh
Browse files
Options
Downloads
Patches
Plain Diff
Revert "MERGED: Fix a bug in the handling of nested orElse"
This reverts commit
5ea49271
.
parent
effbdfe8
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rts/STM.c
+3
-21
3 additions, 21 deletions
rts/STM.c
with
3 additions
and
21 deletions
rts/STM.c
+
3
−
21
View file @
d71d1973
...
...
@@ -1447,28 +1447,10 @@ StgBool stmCommitNestedTransaction(Capability *cap, StgTRecHeader *trec) {
StgTVar
*
s
;
s
=
e
->
tvar
;
// Careful! We might have a read entry here that we don't want
// to spam over the update entry in the enclosing TRec. e.g. in
//
// t <- newTVar 1
// writeTVar t 2
// ((readTVar t >> retry) `orElse` return ()) `orElse` return ()
//
// - the innermost txn first aborts, giving us a read-only entry
// with e->expected_value == e->new_value == 1
// - the inner orElse commits into the outer orElse, which
// lands us here. If we unconditionally did
// merge_update_into(), then we would overwrite the outer
// TRec's update, so we must check whether the entry is an
// update or not, and if not, just do merge_read_into.
//
if
(
entry_is_update
(
e
))
{
if
(
entry_is_update
(
e
))
{
unlock_tvar
(
trec
,
s
,
e
->
expected_value
,
FALSE
);
merge_update_into
(
cap
,
et
,
s
,
e
->
expected_value
,
e
->
new_value
);
}
else
{
merge_read_into
(
cap
,
et
,
s
,
e
->
expected_value
);
}
}
merge_update_into
(
cap
,
et
,
s
,
e
->
expected_value
,
e
->
new_value
);
ACQ_ASSERT
(
s
->
current_value
!=
(
StgClosure
*
)
trec
);
});
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment