Skip to content

Commit 2636e45

Browse files
committed
Fix the head removal issue
1 parent eeed986 commit 2636e45

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Control/Concurrent/STM/TBQueue.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ peekTBQueue (TBQueue _ read _ write _) = do
173173
let (z:zs) = reverse ys -- NB. lazy: we want the transaction to be
174174
-- short, otherwise it will conflict
175175
writeTVar write []
176-
writeTVar read zs
176+
writeTVar read (z:zs)
177177
return z
178178

179179
-- | A version of 'peekTBQueue' which does not retry. Instead it

Control/Concurrent/STM/TQueue.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ peekTQueue (TQueue read write) = do
134134
let (z:zs) = reverse ys -- NB. lazy: we want the transaction to be
135135
-- short, otherwise it will conflict
136136
writeTVar write []
137-
writeTVar read zs
137+
writeTVar read (z:zs)
138138
return z
139139

140140
-- | A version of 'peekTQueue' which does not retry. Instead it

0 commit comments

Comments
 (0)