diff options
Diffstat (limited to 'dht/Presence')
-rw-r--r-- | dht/Presence/Presence.hs | 3 | ||||
-rw-r--r-- | dht/Presence/XMPPServer.hs | 11 |
2 files changed, 5 insertions, 9 deletions
diff --git a/dht/Presence/Presence.hs b/dht/Presence/Presence.hs index 8cdd1cdc..a09a517d 100644 --- a/dht/Presence/Presence.hs +++ b/dht/Presence/Presence.hs | |||
@@ -290,7 +290,8 @@ chooseResourceName state k (Remote addr) clientsNameForMe desired = do | |||
290 | buds <- configText ConfigFiles.getBuddies (clientUser client) (clientProfile client) | 290 | buds <- configText ConfigFiles.getBuddies (clientUser client) (clientProfile client) |
291 | forM_ buds $ \bud -> do | 291 | forM_ buds $ \bud -> do |
292 | let (_,h,_) = splitJID bud | 292 | let (_,h,_) = splitJID bud |
293 | forkIO $ void $ resolvePeer (manager state $ clientProfile client) h | 293 | forkLabeled "XMPP.buddies.resolvePeer" $ do |
294 | void $ resolvePeer (manager state $ clientProfile client) h | ||
294 | 295 | ||
295 | atomically $ do | 296 | atomically $ do |
296 | modifyTVar' (clients state) $ Map.insert k client | 297 | modifyTVar' (clients state) $ Map.insert k client |
diff --git a/dht/Presence/XMPPServer.hs b/dht/Presence/XMPPServer.hs index e98b9a2e..de2dd5d3 100644 --- a/dht/Presence/XMPPServer.hs +++ b/dht/Presence/XMPPServer.hs | |||
@@ -65,12 +65,7 @@ import Control.Monad.Trans (lift) | |||
65 | import Control.Monad.IO.Class (MonadIO, liftIO) | 65 | import Control.Monad.IO.Class (MonadIO, liftIO) |
66 | import Control.Monad.Fix (fix) | 66 | import Control.Monad.Fix (fix) |
67 | import Control.Monad | 67 | import Control.Monad |
68 | #ifdef THREAD_DEBUG | 68 | import Control.Concurrent.ThreadUtil (forkIO,myThreadId,forkLabeled,labelThread,ThreadId,MVar,putMVar,takeMVar,newMVar) |
69 | import Control.Concurrent.Lifted.Instrument (forkIO,myThreadId,labelThread,ThreadId,MVar,putMVar,takeMVar,newMVar) | ||
70 | #else | ||
71 | import Control.Concurrent.Lifted (forkIO,myThreadId,ThreadId) | ||
72 | import GHC.Conc (labelThread) | ||
73 | #endif | ||
74 | import Control.Concurrent.STM | 69 | import Control.Concurrent.STM |
75 | import Data.List hiding ((\\)) | 70 | import Data.List hiding ((\\)) |
76 | -- import Control.Concurrent.STM.TChan | 71 | -- import Control.Concurrent.STM.TChan |
@@ -344,7 +339,7 @@ conduitToChan c = do | |||
344 | chan <- atomically newLockedChan | 339 | chan <- atomically newLockedChan |
345 | clsrs <- atomically $ newTVar (Just []) | 340 | clsrs <- atomically $ newTVar (Just []) |
346 | quitvar <- atomically $ newEmptyTMVar | 341 | quitvar <- atomically $ newEmptyTMVar |
347 | forkIO $ do | 342 | forkLabeled "XMPP.conduitToChan" $ do |
348 | runConduit $ c .| copyToChannel id chan clsrs .| awaitForever (const $ return ()) | 343 | runConduit $ c .| copyToChannel id chan clsrs .| awaitForever (const $ return ()) |
349 | atomically $ writeTVar clsrs Nothing | 344 | atomically $ writeTVar clsrs Nothing |
350 | return (chan,clsrs,quitvar) | 345 | return (chan,clsrs,quitvar) |
@@ -462,7 +457,7 @@ sendReply donevar stype reply replychan = do | |||
462 | , stanzaOrigin = LocalPeer | 457 | , stanzaOrigin = LocalPeer |
463 | } | 458 | } |
464 | ioWriteChan replychan replyStanza | 459 | ioWriteChan replychan replyStanza |
465 | void . liftIO . forkIO $ do | 460 | void . liftIO . forkLabeled "XMPPServer.sendReply" $ do |
466 | mapM_ (liftIO . atomically . writeLChan (stanzaChan replyStanza)) reply | 461 | mapM_ (liftIO . atomically . writeLChan (stanzaChan replyStanza)) reply |
467 | liftIO . atomically $ writeTVar (stanzaClosers replyStanza) Nothing | 462 | liftIO . atomically $ writeTVar (stanzaClosers replyStanza) Nothing |
468 | -- liftIO $ wlog "finished reply stanza" | 463 | -- liftIO $ wlog "finished reply stanza" |