patch applied (packages/base): Add threadStatus :: ThreadId -> IO
simonmarhaskell at gmail.com
Thu Jul 10 12:01:47 EDT 2008
Thu Jul 10 08:17:11 PDT 2008 Simon Marlow <marlowsd at gmail.com>
* Add threadStatus :: ThreadId -> IO ThreadStatus
-- | The current status of a thread
-- ^the thread is currently runnable or running
-- ^the thread has finished
| ThreadBlocked BlockReason
-- ^the thread is blocked on some resource
-- ^the thread received an uncaught exception
-- ^blocked on on 'MVar'
-- ^blocked on a computation in progress by another thread
-- ^blocked in 'throwTo'
-- ^blocked in 'retry' in an STM transaction
-- ^currently in a foreign call
-- ^blocked on some other resource. Without @-threaded@,
-- I/O and 'threadDelay' show up as 'BlockedOnOther', with @-threaded@
-- they show up as 'BlockedOnMVar'.
This is useful for concurrency debugging. I've left threadStatus in
GHC.Conc for now, since the ThreadStatus type is somewhat GHC-specific.
M ./GHC/Conc.lhs +50
View patch online:
More information about the Cvs-libraries