summaryrefslogtreecommitdiff
path: root/rts/RtsStartup.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-11-01 13:10:24 -0500
committerBen Gamari <ben@smart-cactus.org>2020-11-01 13:10:24 -0500
commit8325d6585bd1eb440456abcb05a638c44f2aee88 (patch)
tree772bf37b394969b74a6cc69ce5990f065b0167e6 /rts/RtsStartup.c
parenta9f75fe23b47358bda585e9af3e2b44da7817c37 (diff)
parentbfbe4366e658035a9182500ae286c71fc1ee54fd (diff)
downloadhaskell-8325d6585bd1eb440456abcb05a638c44f2aee88.tar.gz
Merge branch 'wip/tsan/timer' into wip/tsan/all
Diffstat (limited to 'rts/RtsStartup.c')
-rw-r--r--rts/RtsStartup.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
index a3dddb03f5..6dd8c555f1 100644
--- a/rts/RtsStartup.c
+++ b/rts/RtsStartup.c
@@ -285,6 +285,13 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
/* Initialise libdw session pool */
libdwPoolInit();
+ /* Start the "ticker" and profiling timer but don't start until the
+ * scheduler is up. However, the ticker itself needs to be initialized
+ * before the scheduler to ensure that the ticker mutex is initialized as
+ * moreCapabilities will attempt to acquire it.
+ */
+ initTimer();
+
/* initialise scheduler data structures (needs to be done before
* initStorage()).
*/
@@ -366,7 +373,6 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
initHeapProfiling();
/* start the virtual timer 'subsystem'. */
- initTimer();
startTimer();
#if defined(RTS_USER_SIGNALS)