Add mkWeakTMVar to Control.Concurrent.STM.TMVar
|Reported by:||basvandijk||Owned by:||thoughtpolice|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
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 2 years ago by basvandijk
comment:5 Changed 19 months ago by thoughtpolice
- Component changed from libraries (other) to Core Libraries
comment:6 Changed 17 months ago by simonmar
- Cc core-libraries-committee@… added
- Owner set to thoughtpolice
Note: See TracTickets for help on using tickets.