Add mkWeakTMVar to Control.Concurrent.STM.TMVar
|Reported by:||basvandijk||Owned by:||thoughtpolice|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Revisions:|
I just needed a Weak pointer to a TMVar:
-- | Make a 'Weak' pointer to a 'TMVar', using the second argument as -- a finalizer to run when 'TMVar' is garbage-collected. mkWeakTMVar :: TMVar a -> IO () -> IO (Weak (TMVar a)) mkWeakTMVar tmv@(TMVar (TVar t#)) f = IO $ \s -> case mkWeak# t# tmv f s of (# s1, w #) -> (# s1, Weak w #)
It might make sense to add a similar function for TSem as well.
Change History (9)
Changed 11 months ago by basvandijk
comment:5 Changed 6 months ago by thoughtpolice
- Component changed from libraries (other) to Core Libraries
comment:6 Changed 5 months ago by simonmar
- Cc core-libraries-committee@… added
- Owner set to thoughtpolice
Note: See TracTickets for help on using tickets.