Skip to content

Commit f34b66f

Browse files
committed
replace labelThisThread from MonadFork with labelMyThread from Hydra.Prelude
1 parent 75dee26 commit f34b66f

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

hydra-node/test/Hydra/Model.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import Control.Concurrent.Class.MonadSTM (
2727
readTVarIO,
2828
)
2929
import Control.Monad.Class.MonadAsync (async, cancel, link)
30-
import Control.Monad.Class.MonadFork (labelThisThread)
3130
import Data.List (nub, (\\))
3231
import Data.List qualified as List
3332
import Data.Map ((!))
@@ -667,7 +666,7 @@ seedWorld seedKeys seedCP futureCommits = do
667666
seedCP
668667
testDepositPeriod
669668
let testClient = createTestHydraClient outputs messages outputHistory node
670-
nodeThread <- async $ labelThisThread ("node-" <> shortLabel hsk) >> runHydraNode node
669+
nodeThread <- async $ labelMyThread ("node-" <> shortLabel hsk) >> runHydraNode node
671670
link nodeThread
672671
pure (testClient, nodeThread)
673672
pushThread nodeThread

hydra-node/test/Hydra/Model/MockChain.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import Control.Concurrent.Class.MonadSTM (
1717
writeTVar,
1818
)
1919
import Control.Monad.Class.MonadAsync (async, link)
20-
import Control.Monad.Class.MonadFork (labelThisThread)
2120
import Data.Sequence (Seq (Empty, (:|>)))
2221
import Data.Sequence qualified as Seq
2322
import Data.Time (secondsToNominalDiffTime)
@@ -103,7 +102,7 @@ mockChainAndNetwork tr seedKeys commits = do
103102
nodes <- newLabelledTVarIO "nodes" []
104103
queue <- newLabelledTQueueIO "chain-queue"
105104
chain <- newLabelledTVarIO "mock-chain-state" (0 :: ChainSlot, 0 :: Natural, Empty, initialUTxO)
106-
tickThread <- async (labelThisThread "chain" >> simulateChain nodes chain queue)
105+
tickThread <- async (labelMyThread "chain" >> simulateChain nodes chain queue)
107106
link tickThread
108107
pure
109108
SimulatedChainNetwork

hydra-prelude/src/Hydra/Prelude.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import Control.Monad.Class.MonadAsync (
7373
import Control.Monad.Class.MonadEventlog (
7474
MonadEventlog,
7575
)
76-
import Control.Monad.Class.MonadFork (MonadFork, MonadThread, labelThread, myThreadId)
76+
import Control.Monad.Class.MonadFork (MonadFork, MonadThread, labelThread, myThreadId, labelThisThread)
7777
import Control.Monad.Class.MonadST (
7878
MonadST,
7979
)
@@ -350,7 +350,7 @@ newLabelledTBQueueIO = (atomically .) . newLabelledTBQueue
350350
-- * Helpers for labeling Threads
351351

352352
labelMyThread :: MonadThread m => String -> m ()
353-
labelMyThread lbl = myThreadId >>= flip labelThread lbl
353+
labelMyThread = labelThisThread
354354

355355
raceLabelled :: (MonadThread m, MonadAsync m) => (String, m a) -> (String, m b) -> m (Either a b)
356356
raceLabelled (lblA, mA) (lblB, mB) =

0 commit comments

Comments
 (0)