Added labels to blocking conditions.
This commit is contained in:
@@ -363,9 +363,10 @@ rust_dom::log_state() {
|
|||||||
log(rust_log::TASK, "blocked tasks:");
|
log(rust_log::TASK, "blocked tasks:");
|
||||||
for (size_t i = 0; i < blocked_tasks.length(); i++) {
|
for (size_t i = 0; i < blocked_tasks.length(); i++) {
|
||||||
log(rust_log::TASK,
|
log(rust_log::TASK,
|
||||||
"\t task: %s @0x%" PRIxPTR ", blocked on: 0x%" PRIxPTR,
|
"\t task: %s @0x%" PRIxPTR ", blocked on: 0x%" PRIxPTR
|
||||||
|
" '%s'",
|
||||||
blocked_tasks[i]->name, blocked_tasks[i],
|
blocked_tasks[i]->name, blocked_tasks[i],
|
||||||
blocked_tasks[i]->cond);
|
blocked_tasks[i]->cond, blocked_tasks[i]->cond_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -373,7 +374,7 @@ rust_dom::log_state() {
|
|||||||
log(rust_log::TASK, "dead tasks:");
|
log(rust_log::TASK, "dead tasks:");
|
||||||
for (size_t i = 0; i < dead_tasks.length(); i++) {
|
for (size_t i = 0; i < dead_tasks.length(); i++) {
|
||||||
log(rust_log::TASK, "\t task: %s 0x%" PRIxPTR ", ref_count: %d",
|
log(rust_log::TASK, "\t task: %s 0x%" PRIxPTR ", ref_count: %d",
|
||||||
dead_tasks[i], dead_tasks[i]->name,
|
dead_tasks[i]->name, dead_tasks[i],
|
||||||
dead_tasks[i]->ref_count);
|
dead_tasks[i]->ref_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ rust_task::rust_task(rust_dom *dom, rust_task *spawner, const char *name) :
|
|||||||
name(name),
|
name(name),
|
||||||
state(&dom->running_tasks),
|
state(&dom->running_tasks),
|
||||||
cond(NULL),
|
cond(NULL),
|
||||||
|
cond_name("none"),
|
||||||
supervisor(spawner),
|
supervisor(spawner),
|
||||||
idx(0),
|
idx(0),
|
||||||
rendezvous_ptr(0),
|
rendezvous_ptr(0),
|
||||||
@@ -552,7 +553,7 @@ rust_task::transition(ptr_vec<rust_task> *src, ptr_vec<rust_task> *dst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rust_task::block(rust_cond *on)
|
rust_task::block(rust_cond *on, const char* name)
|
||||||
{
|
{
|
||||||
log(rust_log::TASK, "Blocking on 0x%" PRIxPTR ", cond: 0x%" PRIxPTR,
|
log(rust_log::TASK, "Blocking on 0x%" PRIxPTR ", cond: 0x%" PRIxPTR,
|
||||||
(uintptr_t) on, (uintptr_t) cond);
|
(uintptr_t) on, (uintptr_t) cond);
|
||||||
@@ -561,6 +562,7 @@ rust_task::block(rust_cond *on)
|
|||||||
|
|
||||||
transition(&dom->running_tasks, &dom->blocked_tasks);
|
transition(&dom->running_tasks, &dom->blocked_tasks);
|
||||||
cond = on;
|
cond = on;
|
||||||
|
cond_name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -574,6 +576,7 @@ rust_task::wakeup(rust_cond *from)
|
|||||||
transition(&dom->blocked_tasks, &dom->running_tasks);
|
transition(&dom->blocked_tasks, &dom->running_tasks);
|
||||||
I(dom, cond == from);
|
I(dom, cond == from);
|
||||||
cond = NULL;
|
cond = NULL;
|
||||||
|
cond_name = "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ rust_task : public maybe_proxy<rust_task>,
|
|||||||
const char *const name;
|
const char *const name;
|
||||||
ptr_vec<rust_task> *state;
|
ptr_vec<rust_task> *state;
|
||||||
rust_cond *cond;
|
rust_cond *cond;
|
||||||
|
const char *cond_name;
|
||||||
rust_task *supervisor; // Parent-link for failure propagation.
|
rust_task *supervisor; // Parent-link for failure propagation.
|
||||||
size_t idx;
|
size_t idx;
|
||||||
size_t gc_alloc_thresh;
|
size_t gc_alloc_thresh;
|
||||||
@@ -70,7 +71,7 @@ rust_task : public maybe_proxy<rust_task>,
|
|||||||
const char *state_str();
|
const char *state_str();
|
||||||
void transition(ptr_vec<rust_task> *svec, ptr_vec<rust_task> *dvec);
|
void transition(ptr_vec<rust_task> *svec, ptr_vec<rust_task> *dvec);
|
||||||
|
|
||||||
void block(rust_cond *on);
|
void block(rust_cond *on, const char* name);
|
||||||
void wakeup(rust_cond *from);
|
void wakeup(rust_cond *from);
|
||||||
void die();
|
void die();
|
||||||
void unblock();
|
void unblock();
|
||||||
|
|||||||
@@ -191,13 +191,13 @@ upcall_join(rust_task *task, maybe_proxy<rust_task> *target) {
|
|||||||
if (target->is_proxy()) {
|
if (target->is_proxy()) {
|
||||||
notify_message::
|
notify_message::
|
||||||
send(notify_message::JOIN, "join", task, target->as_proxy());
|
send(notify_message::JOIN, "join", task, target->as_proxy());
|
||||||
task->block(target_task);
|
task->block(target_task, "joining remote task");
|
||||||
task->yield(2);
|
task->yield(2);
|
||||||
} else {
|
} else {
|
||||||
// If the other task is already dying, we don't have to wait for it.
|
// If the other task is already dying, we don't have to wait for it.
|
||||||
if (target_task->dead() == false) {
|
if (target_task->dead() == false) {
|
||||||
target_task->tasks_waiting_to_join.push(task);
|
target_task->tasks_waiting_to_join.push(task);
|
||||||
task->block(target_task);
|
task->block(target_task, "joining local task");
|
||||||
task->yield(2);
|
task->yield(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -238,7 +238,7 @@ upcall_recv(rust_task *task, uintptr_t *dptr, rust_port *port) {
|
|||||||
|
|
||||||
task->log(rust_log::COMM, "<=== waiting for rendezvous data ===");
|
task->log(rust_log::COMM, "<=== waiting for rendezvous data ===");
|
||||||
task->rendezvous_ptr = dptr;
|
task->rendezvous_ptr = dptr;
|
||||||
task->block(port);
|
task->block(port, "waiting for rendezvous data");
|
||||||
task->yield(3);
|
task->yield(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user