projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
03ef5bd
)
crucial bugfix: add a store/load memory barrier to popWSDeque()
author
Simon Marlow
<marlowsd@gmail.com>
Fri, 6 Feb 2009 13:08:04 +0000
(13:08 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Fri, 6 Feb 2009 13:08:04 +0000
(13:08 +0000)
rts/parallel/WSDeque.c
patch
|
blob
|
history
diff --git
a/rts/parallel/WSDeque.c
b/rts/parallel/WSDeque.c
index
75ff919
..
4ae9417
100644
(file)
--- a/
rts/parallel/WSDeque.c
+++ b/
rts/parallel/WSDeque.c
@@
-130,7
+130,14
@@
popWSDeque (WSDeque *q)
b = q->bottom;
/* "decrement b as a test, see what happens" */
- q->bottom = --b;
+
+ b--;
+ q->bottom = b;
+
+ // very important that the following read of q->top does not occur
+ // before the earlier write to q->bottom.
+ store_load_barrier();
+
pos = (q->elements) + (b & (q->moduloSize));
t = q->top; /* using topBound would give an *upper* bound, we
need a lower bound. We use the real top here, but