summaryrefslogtreecommitdiff
path: root/rts/Schedule.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2008-06-17 13:46:51 +0000
committerSimon Marlow <marlowsd@gmail.com>2008-06-17 13:46:51 +0000
commitdad784757de1cbe15a78b580ba6e1ac4b6326317 (patch)
tree23b9e65225439f989ee09dc3bdb4e120d7f6103a /rts/Schedule.c
parent301afae5ce9fd9fde20da4cb12b4b19d98ec53da (diff)
downloadhaskell-dad784757de1cbe15a78b580ba6e1ac4b6326317.tar.gz
small interpreter fix
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r--rts/Schedule.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 715517e976..fd84fde490 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -550,8 +550,6 @@ schedule (Capability *initialCapability, Task *task)
}
#endif
- cap->r.rCurrentTSO = t;
-
/* context switches are initiated by the timer signal, unless
* the user specified "context switch as often as possible", with
* +RTS -C0
@@ -563,6 +561,11 @@ schedule (Capability *initialCapability, Task *task)
run_thread:
+ // CurrentTSO is the thread to run. t might be different if we
+ // loop back to run_thread, so make sure to set CurrentTSO after
+ // that.
+ cap->r.rCurrentTSO = t;
+
debugTrace(DEBUG_sched, "-->> running thread %ld %s ...",
(long)t->id, whatNext_strs[t->what_next]);