Skip to content

Commit d26f9d3

Browse files
committed
---
yaml --- r: 6264 b: refs/heads/master c: f619d5e h: refs/heads/master v: v3
1 parent 1d93193 commit d26f9d3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
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: 58e923de6ef89f252f350d0d89f7b13798b517bd
2+
refs/heads/master: f619d5e9e2461c1ef3fb53cbbff325cfb04fb181

trunk/src/rt/rust_port.cpp

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

2424
void rust_port::send(void *sptr) {
25-
// FIXME: Is this lock really necessary? Why do we send with the lock
26-
// but not receive with the lock?
25+
I(task->sched, !lock.lock_held_by_current_thread());
2726
scoped_lock with(lock);
2827

2928
buffer.enqueue(sptr);
@@ -40,6 +39,7 @@ void rust_port::send(void *sptr) {
4039
}
4140

4241
bool rust_port::receive(void *dptr) {
42+
I(task->sched, lock.lock_held_by_current_thread());
4343
if (buffer.is_empty() == false) {
4444
buffer.dequeue(dptr);
4545
LOG(task, comm, "<=== read data ===");
@@ -49,6 +49,7 @@ bool rust_port::receive(void *dptr) {
4949
}
5050

5151
size_t rust_port::size() {
52+
I(task->sched, !lock.lock_held_by_current_thread());
5253
scoped_lock with(lock);
5354
return buffer.size();
5455
}

0 commit comments

Comments
 (0)