summaryrefslogtreecommitdiff
path: root/Assistant/Types/NamedThread.hs
blob: 5dd1364ad224cd8dd58bbc7ce9d3f4c64d7486a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{- named threads
 -
 - Copyright 2012 Joey Hess <joey@kitenet.net>
 -
 - Licensed under the GNU GPL version 3 or higher.
 -}

module Assistant.Types.NamedThread where

import Assistant.Monad
import Assistant.Types.ThreadName

{- Information about a named thread that can be run. -}
data NamedThread = NamedThread Bool ThreadName (Assistant ())

namedThread :: String -> Assistant () -> NamedThread
namedThread = NamedThread True . ThreadName

{- A named thread that can start running before the startup sanity check. -}
namedThreadUnchecked :: String -> Assistant () -> NamedThread
namedThreadUnchecked = NamedThread False . ThreadName