better bound thread
This commit is contained in:
parent
4aaa8665e1
commit
c23c942c2c
1 changed files with 7 additions and 9 deletions
16
Assistant.hs
16
Assistant.hs
|
@ -216,19 +216,17 @@ startAssistant assistant daemonize webappwaiter = withThreadState $ \st -> do
|
||||||
, assist $ transferScannerThread st dstatus scanremotes transferqueue
|
, assist $ transferScannerThread st dstatus scanremotes transferqueue
|
||||||
, assist $ configMonitorThread st dstatus branchhandle commitchan
|
, assist $ configMonitorThread st dstatus branchhandle commitchan
|
||||||
#ifdef WITH_XMPP
|
#ifdef WITH_XMPP
|
||||||
, assist $ pushNotifierThread st dstatus pushnotifier
|
{- Bound thread, because TLS needs it. -}
|
||||||
|
, bound $ assist $ pushNotifierThread st dstatus pushnotifier
|
||||||
#endif
|
#endif
|
||||||
, watch $ watchThread st dstatus transferqueue changechan
|
, watch $ watchThread st dstatus transferqueue changechan
|
||||||
]
|
]
|
||||||
waitForTermination
|
waitForTermination
|
||||||
watch a = (True, a)
|
|
||||||
assist a = (False, a)
|
|
||||||
|
|
||||||
{- Each named thread is started in a bound thread.
|
watch a = (forkIO, True, a)
|
||||||
- (forkOS rather than forkIO). There are not too many,
|
assist a = (forkIO, False, a)
|
||||||
- and this deals with libraries like gnuTLS that
|
bound (_, watcher, t) = (forkOS, watcher, t)
|
||||||
- require only one thread access them. -}
|
startthread dstatus (runner, watcher, t)
|
||||||
startthread dstatus (watcher, t)
|
| watcher || assistant = void $ runner $
|
||||||
| watcher || assistant = void $ forkOS $
|
|
||||||
runNamedThread dstatus t
|
runNamedThread dstatus t
|
||||||
| otherwise = noop
|
| otherwise = noop
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue