Commit fbc3fc41 authored by Simon Marlow's avatar Simon Marlow
Browse files

crucial bugfix: add a store/load memory barrier to popWSDeque()

parent 03ef5bd2
......@@ -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
......
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