Skip to content

Commit 51e21c7

Browse files
committed
---
yaml --- r: 11643 b: refs/heads/master c: e3ccac8 h: refs/heads/master i: 11641: 83f7c8a 11639: 464c8af v: v3
1 parent 260c774 commit 51e21c7

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: fa566ad2fdf4b2bb63af87b2aa6fda3d5d48ce6d
2+
refs/heads/master: e3ccac8ed3b447ffecfbba7402760c083b9e51e2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rt/rust_builtin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ rust_port_detach(rust_port *port) {
489489
// FIXME: Busy waiting until we're the only ref
490490
bool done = false;
491491
while (!done) {
492-
scoped_lock with(task->lock);
492+
scoped_lock with(task->port_lock);
493493
done = port->ref_count == 1;
494494
}
495495
}
@@ -528,7 +528,7 @@ chan_id_send(type_desc *t, rust_task_id target_task_id,
528528
rust_port *port = target_task->get_port_by_id(target_port_id);
529529
if(port) {
530530
port->send(sptr);
531-
scoped_lock with(target_task->lock);
531+
scoped_lock with(target_task->port_lock);
532532
port->deref();
533533
sent = true;
534534
} else {

trunk/src/rt/rust_port.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ rust_port::~rust_port() {
2121
}
2222

2323
void rust_port::detach() {
24-
I(task->thread, !task->lock.lock_held_by_current_thread());
25-
scoped_lock with(task->lock);
24+
I(task->thread, !task->port_lock.lock_held_by_current_thread());
25+
scoped_lock with(task->port_lock);
2626
{
2727
task->release_port(id);
2828
}

trunk/src/rt/rust_port_selector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void
6363
rust_port_selector::msg_sent_on(rust_port *port) {
6464
rust_task *task = port->task;
6565

66-
I(task->thread, !task->lock.lock_held_by_current_thread());
66+
I(task->thread, !task->port_lock.lock_held_by_current_thread());
6767
I(task->thread, !port->lock.lock_held_by_current_thread());
6868
I(task->thread, !rendezvous_lock.lock_held_by_current_thread());
6969

trunk/src/rt/rust_task.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void
108108
rust_task::delete_this()
109109
{
110110
{
111-
scoped_lock with (lock);
111+
scoped_lock with (port_lock);
112112
I(thread, port_table.is_empty());
113113
}
114114

@@ -471,8 +471,8 @@ rust_task::calloc(size_t size, const char *tag) {
471471
}
472472

473473
rust_port_id rust_task::register_port(rust_port *port) {
474-
I(thread, !lock.lock_held_by_current_thread());
475-
scoped_lock with(lock);
474+
I(thread, !port_lock.lock_held_by_current_thread());
475+
scoped_lock with(port_lock);
476476

477477
rust_port_id id = next_port_id++;
478478
A(thread, id != INTPTR_MAX, "Hit the maximum port id");
@@ -481,13 +481,13 @@ rust_port_id rust_task::register_port(rust_port *port) {
481481
}
482482

483483
void rust_task::release_port(rust_port_id id) {
484-
I(thread, lock.lock_held_by_current_thread());
484+
I(thread, port_lock.lock_held_by_current_thread());
485485
port_table.remove(id);
486486
}
487487

488488
rust_port *rust_task::get_port_by_id(rust_port_id id) {
489-
I(thread, !lock.lock_held_by_current_thread());
490-
scoped_lock with(lock);
489+
I(thread, !port_lock.lock_held_by_current_thread());
490+
scoped_lock with(port_lock);
491491
rust_port *port = NULL;
492492
port_table.get(id, &port);
493493
if (port) {
@@ -510,7 +510,7 @@ rust_task::notify(bool success) {
510510
msg.result = !success ? tr_failure : tr_success;
511511

512512
target_port->send(&msg);
513-
scoped_lock with(target_task->lock);
513+
scoped_lock with(target_task->port_lock);
514514
target_port->deref();
515515
}
516516
target_task->deref();

trunk/src/rt/rust_task.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ rust_task : public kernel_owned<rust_task>, rust_cond
8989

9090
bool propagate_failure;
9191

92-
lock_and_signal lock;
93-
92+
// Protects port_table
93+
lock_and_signal port_lock;
9494
hash_map<rust_port_id, rust_port *> port_table;
9595

9696
rust_obstack dynastack;

0 commit comments

Comments
 (0)