Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

Util.Thread

Contents

Synopsis

Documentation

start_logged :: String -> IO () -> IO Concurrent.ThreadId Source #

Start a noisy thread that will log when it starts and stops, and warn if it dies from an exception.

type Seconds = NominalDiffTime Source #

This is just NominalDiffTime, but with a name I might remember.

delay :: Seconds -> IO () Source #

Delay in seconds.

timeout :: Seconds -> IO a -> IO (Maybe a) Source #

Flag

data Flag Source #

A Flag starts False, and can eventually become True. It never goes back to False again.

Instances

Show Flag # 

Methods

showsPrec :: Int -> Flag -> ShowS #

show :: Flag -> String #

showList :: [Flag] -> ShowS #

set :: Flag -> IO () Source #

wait :: Flag -> IO () Source #

Wait until the flag becomes true.

poll :: Seconds -> Flag -> IO Bool Source #

Wait a finite amount of time for the flag to become true.

util

time_action :: IO () -> IO Seconds Source #

Time an IO action in seconds. Technically not thread related, but I don't have a better place at the moment.