projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle deps with numbers in them, like 'wsock32'.
[ghc-hetmet.git]
/
rts
/
Threads.c
diff --git
a/rts/Threads.c
b/rts/Threads.c
index
1d871a5
..
3b209ea
100644
(file)
--- a/
rts/Threads.c
+++ b/
rts/Threads.c
@@
-8,10
+8,8
@@
#include "PosixSource.h"
#include "Rts.h"
#include "PosixSource.h"
#include "Rts.h"
-#include "SchedAPI.h"
-#include "Storage.h"
+
#include "Threads.h"
#include "Threads.h"
-#include "RtsFlags.h"
#include "STM.h"
#include "Schedule.h"
#include "Trace.h"
#include "STM.h"
#include "Schedule.h"
#include "Trace.h"
@@
-77,7
+75,8
@@
createThread(Capability *cap, nat size)
tso->why_blocked = NotBlocked;
tso->blocked_exceptions = END_TSO_QUEUE;
tso->why_blocked = NotBlocked;
tso->blocked_exceptions = END_TSO_QUEUE;
- tso->flags = TSO_DIRTY;
+ tso->flags = 0;
+ tso->dirty = 1;
tso->saved_errno = 0;
tso->bound = NULL;
tso->saved_errno = 0;
tso->bound = NULL;
@@
-107,11
+106,9
@@
createThread(Capability *cap, nat size)
g0s0->threads = tso;
RELEASE_LOCK(&sched_mutex);
g0s0->threads = tso;
RELEASE_LOCK(&sched_mutex);
- postEvent (cap, EVENT_CREATE_THREAD, tso->id, 0);
+ // ToDo: report the stack size in the event?
+ traceSchedEvent (cap, EVENT_CREATE_THREAD, tso, tso->stack_size);
- debugTrace(DEBUG_sched,
- "created thread %ld, stack size = %lx words",
- (long)tso->id, (long)tso->stack_size);
return tso;
}
return tso;
}
@@
-257,10
+254,7
@@
unblockOne_ (Capability *cap, StgTSO *tso,
cap->context_switch = 1;
#endif
cap->context_switch = 1;
#endif
- 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);
+ traceSchedEvent (cap, EVENT_THREAD_WAKEUP, tso, tso->cap->no);
return next;
}
return next;
}
@@
-358,6
+352,7
@@
printThreadBlockage(StgTSO *tso)
}
}
}
}
+
void
printThreadStatus(StgTSO *t)
{
void
printThreadStatus(StgTSO *t)
{
@@
-379,7
+374,7
@@
printThreadStatus(StgTSO *t)
default:
printThreadBlockage(t);
}
default:
printThreadBlockage(t);
}
- if (t->flags & TSO_DIRTY) {
+ if (t->dirty) {
debugBelch(" (TSO_DIRTY)");
} else if (t->flags & TSO_LINK_DIRTY) {
debugBelch(" (TSO_LINK_DIRTY)");
debugBelch(" (TSO_DIRTY)");
} else if (t->flags & TSO_LINK_DIRTY) {
debugBelch(" (TSO_LINK_DIRTY)");