projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add getNumberOfProcessors(), FIX MacOS X build problem (hopefully)
[ghc-hetmet.git]
/
rts
/
Capability.c
diff --git
a/rts/Capability.c
b/rts/Capability.c
index
a81d710
..
bd6d56f
100644
(file)
--- a/
rts/Capability.c
+++ b/
rts/Capability.c
@@
-294,10
+294,10
@@
initCapabilities( void )
void setContextSwitches(void)
{
void setContextSwitches(void)
{
- nat i;
- for (i=0; i < n_capabilities; i++) {
- capabilities[i].context_switch = 1;
- }
+ nat i;
+ for (i=0; i < n_capabilities; i++) {
+ contextSwitchCapability(&capabilities[i]);
+ }
}
/* ----------------------------------------------------------------------------
}
/* ----------------------------------------------------------------------------
@@
-482,14
+482,17
@@
waitForReturnCapability (Capability **pCap, Task *task)
if (!cap->running_task) {
nat i;
// otherwise, search for a free capability
if (!cap->running_task) {
nat i;
// otherwise, search for a free capability
+ cap = NULL;
for (i = 0; i < n_capabilities; i++) {
for (i = 0; i < n_capabilities; i++) {
- cap = &capabilities[i];
- if (!cap->running_task) {
+ if (!capabilities[i].running_task) {
+ cap = &capabilities[i];
break;
}
}
break;
}
}
- // Can't find a free one, use last_free_capability.
- cap = last_free_capability;
+ if (cap == NULL) {
+ // Can't find a free one, use last_free_capability.
+ cap = last_free_capability;
+ }
}
// record the Capability as the one this Task is now assocated with.
}
// record the Capability as the one this Task is now assocated with.