summaryrefslogtreecommitdiff
path: root/fibers
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-12-29 19:06:12 +0100
committerAndy Wingo <wingo@pobox.com>2016-12-29 19:06:12 +0100
commit847833ceaeff1a1b70d41fdae53f214a012c5e47 (patch)
treec82b63b902f7d0fd5ddd25be98a92ec8787c26db /fibers
parentRemove #:keep-scheduler? arg (diff)
downloadguile-fibers-847833ceaeff1a1b70d41fdae53f214a012c5e47.tar.gz
C-c works on threads stuck in epoll
* epoll.c (scm_primitive_epoll_wait): Add wakefd argument, and use facilities from git guile to ensure that C-c will wake a thread sleeping in epoll. (init_fibers_epoll): Declare additional primitive-epoll-wait arg. * fibers/epoll.scm (epoll): Tell Guile about the wake fd.
Diffstat (limited to 'fibers')
-rw-r--r--fibers/epoll.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/fibers/epoll.scm b/fibers/epoll.scm
index 005321d..2853d21 100644
--- a/fibers/epoll.scm
+++ b/fibers/epoll.scm
@@ -149,7 +149,9 @@ epoll wait (if appropriate)."
(atomic-box-set! (epoll-state epoll) 'waiting)
(let* ((maxevents (epoll-maxevents epoll))
(eventsv (ensure-epoll-eventsv epoll maxevents))
- (n (primitive-epoll-wait (epoll-fd epoll) eventsv (get-timeout)))
+ (write-pipe-fd (fileno (epoll-wake-write-pipe epoll)))
+ (n (primitive-epoll-wait (epoll-fd epoll) write-pipe-fd
+ eventsv (get-timeout)))
(read-pipe (epoll-wake-read-pipe epoll))
(read-pipe-fd (fileno read-pipe)))
;; If we received `maxevents' events, it means that probably there