diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-07-21 11:18:14 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-07-26 04:55:03 -0400 |
commit | 5f3991c7cab8ccc9ab8daeebbfce57afbd9acc33 (patch) | |
tree | 72e2bbaa8270290a8464c557c863cf0551f9abfa /rts/posix | |
parent | 5b39a10781da9d428bf98d934d0f82eb55054183 (diff) | |
download | haskell-5f3991c7cab8ccc9ab8daeebbfce57afbd9acc33.tar.gz |
RTS: try to fix timer races
* Pthread based timer was initialized started while some other parts of
the RTS assume it is initialized stopped, e.g. in hs_init_ghc:
/* 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.
*/
* after a fork, don't start the timer before the IOManager is
initialized: the timer handler (handle_tick) might call wakeUpRts to
perform an idle GC, which calls wakeupIOManager/ioManagerWakeup
Found while debugging #18033/#20132 but I couldn't confirm if it fixes
them.
Diffstat (limited to 'rts/posix')
-rw-r--r-- | rts/posix/itimer/Pthread.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/posix/itimer/Pthread.c b/rts/posix/itimer/Pthread.c index 5098d4f117..84501acb6f 100644 --- a/rts/posix/itimer/Pthread.c +++ b/rts/posix/itimer/Pthread.c @@ -169,7 +169,7 @@ void initTicker (Time interval, TickProc handle_tick) { itimer_interval = interval; - stopped = false; + stopped = true; exited = false; #if defined(HAVE_SIGNAL_H) sigset_t mask, omask; |