diff --git a/Control/Concurrent/STM/TMVar.hs b/Control/Concurrent/STM/TMVar.hs index d6ba0ef3eca276ae6a62364ae97735bc5e0a637a..69dacab09b7e26129ef52e8df2ad3d828b1d6a28 100644 --- a/Control/Concurrent/STM/TMVar.hs +++ b/Control/Concurrent/STM/TMVar.hs @@ -151,8 +151,10 @@ swapTMVar (TMVar t) new = do -- | Non-blocking write of a new value to a 'TMVar' -- Puts if empty. Replaces if populated. +-- +-- @since 2.5.1 writeTMVar :: TMVar a -> a -> STM () -writeTMVar t new = tryTakeTMVar t >> putTMVar t new +writeTMVar (TMVar t) new = writeTVar t (Just new) -- |Check whether a given 'TMVar' is empty. isEmptyTMVar :: TMVar a -> STM Bool diff --git a/tests/all.T b/tests/all.T index 8f50fb5be42faee50ebad89182f2ed79ebd00417..f8ac83be3a9680941cd6a6ff48aa92abd380fd2e 100644 --- a/tests/all.T +++ b/tests/all.T @@ -16,4 +16,4 @@ test('stm065', normal, compile_and_run, ['-package stm']) test('cloneTChan001', normal, compile_and_run, ['-package stm']) test('T15136', extra_run_opts('20'), compile_and_run, ['-package stm']) -test('T16707', normal, compile_and_run, ['']) +test('T16707', js_broken(22576), compile_and_run, [''])