Skip to content

Commit 43fd0ea

Browse files
committed
Disable pthread and itimer timers for non threaded RTS
1 parent 8948bb6 commit 43fd0ea

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

overlays/bootstrap.nix

+2
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ in {
284284

285285
# See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12586
286286
++ onWindows (fromUntil "9.6.6" "9.12" ./patches/ghc/ghc-win32-io-manager-compilation.patch)
287+
288+
++ from "9.8.4" ./patches/ghc/ghc-9.8-threaded-rts-timer.patch
287289
;
288290
in ({
289291
ghc8107 = traceWarnOld "8.10" (final.callPackage ../compiler/ghc {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/rts/posix/Ticker.c b/rts/posix/Ticker.c
2+
index 18bf1179dd..9ecfb1ff97 100644
3+
--- a/rts/posix/Ticker.c
4+
+++ b/rts/posix/Ticker.c
5+
@@ -62,7 +62,7 @@
6+
#endif
7+
8+
/*
9+
- * On Linux we can use timerfd_* (introduced in Linux
10+
+ * On Linux in the threaded RTS we can use timerfd_* (introduced in Linux
11+
* 2.6.25) and a thread instead of alarm signals. It avoids the risk of
12+
* interrupting syscalls (see #10840) and the risk of being accidentally
13+
* modified in user code using signals. NetBSD has also added timerfd
14+
@@ -71,11 +71,11 @@
15+
* For older version of linux/netbsd without timerfd we fall back to the
16+
* pthread based implementation.
17+
*/
18+
-#if defined(HAVE_SYS_TIMERFD_H)
19+
+#if defined(HAVE_SYS_TIMERFD_H) && defined(THREADED_RTS)
20+
#define USE_TIMERFD_FOR_ITIMER
21+
#endif
22+
23+
-#if defined(linux_HOST_OS)
24+
+#if defined(linux_HOST_OS) && defined(THREADED_RTS)
25+
#define USE_PTHREAD_FOR_ITIMER
26+
#endif

0 commit comments

Comments
 (0)