Skip to content

Commit 57f0009

Browse files
committed
---
yaml --- r: 468 b: refs/heads/master c: 5917ca3 h: refs/heads/master v: v3
1 parent 9db76a3 commit 57f0009

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 4641fcef616a7ee1eece4f00f757958757deb438
2+
refs/heads/master: 5917ca35190b526b65b4d26ad0b98024ce9e0b09

trunk/src/rt/rust_dom.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,6 @@ void rust_dom::send_message(rust_message *message) {
262262
this);
263263
A(this, message->dom == this, "Message owned by non-local domain.");
264264
_incoming_message_queue.enqueue(message);
265-
_incoming_message_pending.signal();
266-
_progress.signal();
267265
}
268266

269267
/**
@@ -398,9 +396,11 @@ rust_dom::start_main_loop()
398396
"all tasks are blocked, waiting for progress ...");
399397
if (_log.is_tracing(rust_log::TASK))
400398
log_state();
401-
_progress.wait();
402399
log(rust_log::TASK,
403-
"progress made, resuming ...");
400+
"all tasks are blocked, scheduler yielding ...");
401+
sync::yield();
402+
log(rust_log::TASK,
403+
"scheduler resuming ...");
404404
continue;
405405
}
406406

@@ -450,7 +450,14 @@ rust_dom::start_main_loop()
450450
}
451451

452452
if (_incoming_message_queue.is_empty()) {
453-
_incoming_message_pending.wait();
453+
log(rust_log::DOM,
454+
"waiting for %d dead tasks to become dereferenced, "
455+
"scheduler yielding ...",
456+
dead_tasks.length());
457+
if (_log.is_tracing(rust_log::TASK)) {
458+
log_state();
459+
}
460+
sync::yield();
454461
} else {
455462
drain_incoming_message_queue();
456463
}

trunk/src/rt/rust_dom.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,10 @@ struct rust_dom
3434
rust_task *curr_task;
3535
int rval;
3636

37-
condition_variable _progress;
38-
3937
hash_map<rust_task *, rust_proxy<rust_task> *> _task_proxies;
4038
hash_map<rust_port *, rust_proxy<rust_port> *> _port_proxies;
4139

4240
// Incoming messages from other domains.
43-
condition_variable _incoming_message_pending;
4441
lock_free_queue _incoming_message_queue;
4542

4643
#ifndef __WIN32__

trunk/src/rt/rust_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ extern "C" {
3838
#error "Platform not supported."
3939
#endif
4040

41+
#include "sync/sync.h"
4142
#include "sync/condition_variable.h"
4243

4344
#ifndef __i386__

trunk/src/rt/rust_task.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,6 @@ rust_task::wakeup(rust_cond *from)
556556
A(dom, cond == from, "Cannot wake up blocked task on wrong condition.");
557557

558558
transition(&dom->blocked_tasks, &dom->running_tasks);
559-
// TODO: Signaling every time the task is awaken is kind of silly,
560-
// do this a nicer way.
561-
dom->_progress.signal();
562559
I(dom, cond == from);
563560
cond = NULL;
564561
}

0 commit comments

Comments
 (0)