Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Data/Vault/ST/backends/IORef.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ lock (Key u ref) x = Locker u $ writeIORef ref $ Just x
unlock (Key k ref) (Locker k' m)
| k == k' = unsafePerformIO $ do
m
readIORef ref -- FIXME: race condition!
-- FIXME: race condition!
--
-- If another unlock action is run concurrently with this one
-- on the same Key but a different Locker then that one may
-- overwrite ref with its value before this one has had a
-- chance to read from it, so this one may obtain the wrong
-- result.
readIORef ref
| otherwise = Nothing

{-----------------------------------------------------------------------------
Expand Down
Loading