projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
non-threaded RTS: don't assume deadlock if there are signal handlers to run
[ghc-hetmet.git]
/
rts
/
Schedule.c
diff --git
a/rts/Schedule.c
b/rts/Schedule.c
index
c07b21a
..
ce6a1db
100644
(file)
--- a/
rts/Schedule.c
+++ b/
rts/Schedule.c
@@
-550,8
+550,6
@@
schedule (Capability *initialCapability, Task *task)
}
#endif
}
#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
/* 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:
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]);
debugTrace(DEBUG_sched, "-->> running thread %ld %s ...",
(long)t->id, whatNext_strs[t->what_next]);
@@
-1002,6
+1005,8
@@
scheduleDetectDeadlock (Capability *cap, Task *task)
// either we have threads to run, or we were interrupted:
ASSERT(!emptyRunQueue(cap) || sched_state >= SCHED_INTERRUPTING);
// either we have threads to run, or we were interrupted:
ASSERT(!emptyRunQueue(cap) || sched_state >= SCHED_INTERRUPTING);
+
+ return;
}
#endif
}
#endif
@@
-2819,6
+2824,8
@@
threadStackUnderflow (Task *task STG_UNUSED, StgTSO *tso)
bd = Bdescr((StgPtr)tso);
new_bd = splitLargeBlock(bd, new_tso_size_w / BLOCK_SIZE_W);
bd = Bdescr((StgPtr)tso);
new_bd = splitLargeBlock(bd, new_tso_size_w / BLOCK_SIZE_W);
+ new_bd->free = bd->free;
+ bd->free = bd->start + TSO_STRUCT_SIZEW;
new_tso = (StgTSO *)new_bd->start;
memcpy(new_tso,tso,TSO_STRUCT_SIZE);
new_tso = (StgTSO *)new_bd->start;
memcpy(new_tso,tso,TSO_STRUCT_SIZE);