Skip to content

Potential deadlock in simHasFS #82

Open
@jorisdral

Description

@jorisdral

sim :: FSSimT m a -> m a
sim m = do
st <- atomically $ takeTMVar var
runFSSimT m st >>= \case
Left e -> do
atomically $ putTMVar var st
throwIO e
Right (a, st') -> do
atomically $ putTMVar var st'
pure a

If an exception happens between takeTMVar and putTMVar, then the TMVar will be left empty. This is a potential deadlock situation

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions