diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2020-04-02 11:29:55 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-07-15 16:41:02 -0400 |
commit | 99db46e09c50681e35de75d8bfec6cfb9ac3f9fc (patch) | |
tree | 110a193431d1974306b9c7dcc3dac7e5a0f39a2c | |
parent | 39afc4a785a37f238a9004b2f6882d1951953c07 (diff) | |
download | haskell-99db46e09c50681e35de75d8bfec6cfb9ac3f9fc.tar.gz |
winio: Assign thread labels to IOManager threads.
-rw-r--r-- | libraries/base/GHC/Conc/POSIX.hs | 4 | ||||
-rw-r--r-- | libraries/base/GHC/Event/Windows.hsc | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/libraries/base/GHC/Conc/POSIX.hs b/libraries/base/GHC/Conc/POSIX.hs index 9a5243c2c0..8879284b93 100644 --- a/libraries/base/GHC/Conc/POSIX.hs +++ b/libraries/base/GHC/Conc/POSIX.hs @@ -175,7 +175,9 @@ interruptIOManager = return () startIOManagerThread :: IO () startIOManagerThread = do modifyMVar_ ioManagerThread $ \old -> do - let create = do t <- forkIO ioManager; return (Just t) + let create = do t <- forkIO ioManager; + labelThread t "IOManagerThread"; + return (Just t) case old of Nothing -> create Just t -> do diff --git a/libraries/base/GHC/Event/Windows.hsc b/libraries/base/GHC/Event/Windows.hsc index 8250718a9d..c790b095ef 100644 --- a/libraries/base/GHC/Event/Windows.hsc +++ b/libraries/base/GHC/Event/Windows.hsc @@ -114,7 +114,7 @@ import Text.Show #if 1 import Foreign.C import System.Posix.Internals (c_write) -import GHC.Conc.Sync (myThreadId) +import GHC.Conc.Sync (myThreadId, labelThread) #endif import qualified GHC.Windows as Win32 @@ -394,6 +394,7 @@ startIOManagerThread loop = do then forkOS loop else forkIO loop debugIO $ "created io-manager threads." + labelThread t "IOManagerThread" return (Just t) debugIO $ "startIOManagerThread old=" ++ show old case old of |