From 8da15a09955926c4617d3468b84b3f3ca414d48a Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Fri, 30 Aug 2019 21:47:44 +0100 Subject: winio: Fix a scheduler bug with the threaded-runtime. --- rts/Schedule.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'rts/Schedule.c') diff --git a/rts/Schedule.c b/rts/Schedule.c index fab357aa06..e3f582e967 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -318,19 +318,12 @@ schedule (Capability *initialCapability, Task *task) #if !defined(THREADED_RTS) if ( emptyRunQueue(cap) ) { - /* On the non-threaded RTS if the queue is empty and the last action was - blocked on an I/O completion port, then just wait till we're woken - up by the RTS with more work. */ - if (t && t->why_blocked == BlockedOnIOCompletion) - { - fprintf (stderr, "waiting: %d.\n", t->why_blocked); - awaitEvent (emptyRunQueue(cap)); - fprintf (stderr, "running: %d.\n", t->why_blocked); - continue; - } - continue; - -#if !defined(mingw32_HOST_OS) +#if defined(mingw32_HOST_OS) + /* Notify the I/O manager that we have nothing to do. If there are + any outstanding I/O requests we'll block here. If there are not + then this is a user error and we will abort soon. */ + awaitEvent (emptyRunQueue(cap)); +#else ASSERT(sched_state >= SCHED_INTERRUPTING); #endif } -- cgit v1.2.1