diff options
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Schedule.c | 8 | ||||
-rw-r--r-- | rts/Schedule.h | 4 | ||||
-rw-r--r-- | rts/win32/AsyncWinIO.c | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c index 8c120c093e..6b10326859 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -2577,6 +2577,14 @@ scheduleThread(Capability *cap, StgTSO *tso) } void +scheduleThreadNow(Capability *cap, StgTSO *tso) +{ + // The thread goes at the *beginning* of the run-queue, + // in order to execute it as soon as possible. + pushOnRunQueue(cap,tso); +} + +void scheduleThreadOn(Capability *cap, StgWord cpu USED_IF_THREADS, StgTSO *tso) { tso->flags |= TSO_LOCKED; // we requested explicit affinity; don't diff --git a/rts/Schedule.h b/rts/Schedule.h index 89ab6e0b4c..a550a6763a 100644 --- a/rts/Schedule.h +++ b/rts/Schedule.h @@ -27,6 +27,10 @@ void markScheduler (evac_fn evac, void *user); // Place a new thread on the run queue of the current Capability void scheduleThread (Capability *cap, StgTSO *tso); +// Place a new thread on the run queue of the current Capability +// at the front of the queue. +void scheduleThreadNow (Capability *cap, StgTSO *tso); + // Place a new thread on the run queue of a specified Capability // (cap is the currently owned Capability, cpu is the number of // the desired Capability). diff --git a/rts/win32/AsyncWinIO.c b/rts/win32/AsyncWinIO.c index 6bacf48eb1..a280c28bde 100644 --- a/rts/win32/AsyncWinIO.c +++ b/rts/win32/AsyncWinIO.c @@ -426,7 +426,7 @@ bool queueIOThread() StgTSO * tso = createStrictIOThread (cap, RtsFlags.GcFlags.initialStkSize, processRemoteCompletion_closure); ASSERT(tso); - scheduleThread (cap, tso); + scheduleThreadNow (cap, tso); result = true; } ReleaseSRWLockExclusive (&lock); |