summaryrefslogtreecommitdiff
path: root/src/kern/tru64/tru64.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/kern/tru64/tru64.hh')
-rw-r--r--src/kern/tru64/tru64.hh27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/kern/tru64/tru64.hh b/src/kern/tru64/tru64.hh
index dfdb8524d..5f8307cd2 100644
--- a/src/kern/tru64/tru64.hh
+++ b/src/kern/tru64/tru64.hh
@@ -789,21 +789,18 @@ class Tru64 : public OperatingSystem
slot_state.copyOut(tc->getMemPort());
// Find a free simulator thread context.
- for (int i = 0; i < process->numCpus(); ++i) {
- ThreadContext *tc = process->threadContexts[i];
-
- if (tc->status() == ThreadContext::Unallocated) {
- // inactive context... grab it
- init_thread_context(tc, attrp, uniq_val);
-
- // This is supposed to be a port number, but we'll try
- // and get away with just sticking the thread index
- // here.
- *kidp = htog(thread_index);
- kidp.copyOut(tc->getMemPort());
-
- return 0;
- }
+ ThreadContext *tc = process->findFreeContext();
+ if (tc) {
+ // inactive context... grab it
+ init_thread_context(tc, attrp, uniq_val);
+
+ // This is supposed to be a port number, but we'll try
+ // and get away with just sticking the thread index
+ // here.
+ *kidp = htog(thread_index);
+ kidp.copyOut(tc->getMemPort());
+
+ return 0;
}
// fell out of loop... no available inactive context