diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-02-26 21:25:23 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-10-24 21:02:23 -0400 |
commit | 1726ec419f3c537b28e1290424203c586408bd41 (patch) | |
tree | a869178e620566865c9378b5994359e6dd973fed | |
parent | 9a528985e8e738b4987b58938fad5711af81b61a (diff) | |
download | haskell-1726ec419f3c537b28e1290424203c586408bd41.tar.gz |
rts: Fix timer initialization
Previously `initScheduler` would attempt to pause the ticker and in so
doing acquire the ticker mutex. However, initTicker, which is
responsible for initializing said mutex, hadn't been called
yet.
-rw-r--r-- | rts/RtsStartup.c | 8 |
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) |