open :: TimeoutManager -> TimeoutInUs -> Finalizer -> IO (Int, Handle)
open (TimeoutManager ref) timeout fin = do
  tm     <- getSystemTimerManager
  active <- atomicModifyIORef' ref (\x -> (x + 1, x + 1))
  ioref  <- newIORef (atomicModifyIORef' ref (\x -> (x - 1, ())))
  cookie <- registerTimeout tm timeout (executeOnce ioref >> fin)
  return (active, Handle timeout cookie ioref)
open :: TimeoutManager -> TimeoutInUs -> Finalizer -> IO (Int, Handle)
open (TimeoutManager ref) timeout fin = do
  tm     <- getSystemTimerManager
  active <- atomicModifyIORef' ref (\x -> (x + 1, x + 1))
  ioref  <- newIORef (atomicModifyIORef' ref (\x -> (x - 1, ())))
  cookie <- registerTimeout tm timeout (executeOnce ioref >> fin)
  return (active, Handle timeout cookie ioref)
open (TimeoutManager ref) timeout fin = do
  tm     <- getSystemTimerManager
  active <- atomicModifyIORef' ref (\x -> (x + 1, x + 1))
  ioref  <- newIORef (atomicModifyIORef' ref (\x -> (x - 1, ())))
  cookie <- registerTimeout tm timeout (executeOnce ioref >> fin)
  return (active, Handle timeout cookie ioref)