projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use -w when compiling libffi, to stop -Werror failures
[ghc-hetmet.git]
/
rts
/
Threads.c
diff --git
a/rts/Threads.c
b/rts/Threads.c
index
65eaf8d
..
0bc725c
100644
(file)
--- a/
rts/Threads.c
+++ b/
rts/Threads.c
@@
-84,9
+84,10
@@
createThread(Capability *cap, nat size)
size = MIN_STACK_WORDS + TSO_STRUCT_SIZEW;
}
size = MIN_STACK_WORDS + TSO_STRUCT_SIZEW;
}
- stack_size = size - TSO_STRUCT_SIZEW;
-
+ size = round_to_mblocks(size);
tso = (StgTSO *)allocateLocal(cap, size);
tso = (StgTSO *)allocateLocal(cap, size);
+
+ stack_size = size - TSO_STRUCT_SIZEW;
TICK_ALLOC_TSO(stack_size, 0);
SET_HDR(tso, &stg_TSO_info, CCS_SYSTEM);
TICK_ALLOC_TSO(stack_size, 0);
SET_HDR(tso, &stg_TSO_info, CCS_SYSTEM);
@@
-210,6
+211,8
@@
createThread(Capability *cap, nat size)
}
#endif
}
#endif
+ postEvent (cap, EVENT_CREATE_THREAD, tso->id, 0);
+
#if defined(GRAN)
debugTrace(GRAN_DEBUG_pri,
"==__ schedule: Created TSO %d (%p);",
#if defined(GRAN)
debugTrace(GRAN_DEBUG_pri,
"==__ schedule: Created TSO %d (%p);",
@@
-503,10
+506,13
@@
unblockOne_ (Capability *cap, StgTSO *tso,
ASSERT(tso->bound->cap == tso->cap);
tso->bound->cap = cap;
}
ASSERT(tso->bound->cap == tso->cap);
tso->bound->cap = cap;
}
+
tso->cap = cap;
appendToRunQueue(cap,tso);
tso->cap = cap;
appendToRunQueue(cap,tso);
- // we're holding a newly woken thread, make sure we context switch
- // quickly so we can migrate it if necessary.
+
+ // context-switch soonish so we can migrate the new thread if
+ // necessary. NB. not contextSwitchCapability(cap), which would
+ // force a context switch immediately.
cap->context_switch = 1;
} else {
// we'll try to wake it up on the Capability it was last on.
cap->context_switch = 1;
} else {
// we'll try to wake it up on the Capability it was last on.
@@
-514,11
+520,16
@@
unblockOne_ (Capability *cap, StgTSO *tso,
}
#else
appendToRunQueue(cap,tso);
}
#else
appendToRunQueue(cap,tso);
+
+ // context-switch soonish so we can migrate the new thread if
+ // necessary. NB. not contextSwitchCapability(cap), which would
+ // force a context switch immediately.
cap->context_switch = 1;
#endif
cap->context_switch = 1;
#endif
- debugTrace(DEBUG_sched,
- "waking up thread %ld on cap %d",
+ postEvent (cap, EVENT_THREAD_WAKEUP, tso->id, tso->cap->no);
+
+ debugTrace(DEBUG_sched, "waking up thread %ld on cap %d",
(long)tso->id, tso->cap->no);
return next;
(long)tso->id, tso->cap->no);
return next;
@@
-763,6
+774,11
@@
printThreadStatus(StgTSO *t)
default:
printThreadBlockage(t);
}
default:
printThreadBlockage(t);
}
+ if (t->flags & TSO_DIRTY) {
+ debugBelch(" (TSO_DIRTY)");
+ } else if (t->flags & TSO_LINK_DIRTY) {
+ debugBelch(" (TSO_LINK_DIRTY)");
+ }
debugBelch("\n");
}
}
debugBelch("\n");
}
}