File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 58e923de6ef89f252f350d0d89f7b13798b517bd
2
+ refs/heads/master: f619d5e9e2461c1ef3fb53cbbff325cfb04fb181
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ rust_port::~rust_port() {
22
22
}
23
23
24
24
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 ());
27
26
scoped_lock with (lock);
28
27
29
28
buffer.enqueue (sptr);
@@ -40,6 +39,7 @@ void rust_port::send(void *sptr) {
40
39
}
41
40
42
41
bool rust_port::receive (void *dptr) {
42
+ I (task->sched , lock.lock_held_by_current_thread ());
43
43
if (buffer.is_empty () == false ) {
44
44
buffer.dequeue (dptr);
45
45
LOG (task, comm, " <=== read data ===" );
@@ -49,6 +49,7 @@ bool rust_port::receive(void *dptr) {
49
49
}
50
50
51
51
size_t rust_port::size () {
52
+ I (task->sched , !lock.lock_held_by_current_thread ());
52
53
scoped_lock with (lock);
53
54
return buffer.size ();
54
55
}
You can’t perform that action at this time.
0 commit comments