From f8ff013e3cc737b92b5a140dfd0ddcc5ab6773d9 Mon Sep 17 00:00:00 2001 From: Michael Bebenita Date: Fri, 27 Aug 2010 18:26:36 -0700 Subject: Added a few utility classes, cleaned up the include order of .h files, and started to make the Rust kernel own domain message queues rather than the Rust domains themselves. --- src/rt/rust_dom.cpp | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'src/rt/rust_dom.cpp') diff --git a/src/rt/rust_dom.cpp b/src/rt/rust_dom.cpp index dc42286da8a..a1207ec738a 100644 --- a/src/rt/rust_dom.cpp +++ b/src/rt/rust_dom.cpp @@ -4,9 +4,6 @@ template class ptr_vec; -// Keeps track of all live domains, for debugging purposes. -array_list _live_domains; - rust_dom::rust_dom(rust_srv *srv, rust_crate const *root_crate, const char *name) : interrupt_flag(0), @@ -22,7 +19,8 @@ rust_dom::rust_dom(rust_srv *srv, rust_crate const *root_crate, caches(this), root_task(NULL), curr_task(NULL), - rval(0) + rval(0), + _kernel(srv->kernel) { logptr("new dom", (uintptr_t)this); isaac_init(this, &rctx); @@ -32,10 +30,6 @@ rust_dom::rust_dom(rust_srv *srv, rust_crate const *root_crate, pthread_attr_setdetachstate(&attr, true); #endif root_task = new (this) rust_task(this, NULL, name); - - if (_live_domains.replace(NULL, this) == false) { - _live_domains.append(this); - } } static void @@ -86,8 +80,6 @@ rust_dom::~rust_dom() { #endif while (caches.length()) delete caches.pop(); - - _live_domains.replace(this, NULL); } void @@ -375,7 +367,7 @@ rust_dom::schedule_task() { */ bool rust_dom::is_deadlocked() { - if (_live_domains.size() != 1) { + if (_kernel->domains.length() != 1) { // We cannot tell if we are deadlocked if other domains exists. return false; } @@ -388,20 +380,13 @@ rust_dom::is_deadlocked() { if (_incoming_message_queue.is_empty() && blocked_tasks.length() > 0) { // We have no messages to process, no running tasks to schedule // and some blocked tasks therefore we are likely in a deadlock. - log_state(); + _kernel->log_all_domain_state(); return true; } return false; } -void -rust_dom::log_all_state() { - for (uint32_t i = 0; i < _live_domains.size(); i++) { - _live_domains[i]->log_state(); - } -} - void rust_dom::log_state() { if (!running_tasks.is_empty()) { -- cgit 1.4.1-3-g733a5