Skip to content

Commit 41295f7

Browse files
committed
---
yaml --- r: 31659 b: refs/heads/dist-snap c: 86947e4 h: refs/heads/master i: 31657: c531fce 31655: fa53e97 v: v3
1 parent 13f4cb6 commit 41295f7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: d8e9724fb1b14a415d922431a5bc74f937c9ff38
10+
refs/heads/dist-snap: 86947e47ad057d50209cf8a022f088c22089433f
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/libcore/pipes.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,21 @@ buffer that is carried along in the endpoint data structures.
4141
4242
FIXME (#3072) - This is still incomplete
4343
44+
45+
46+
## Invariants
47+
48+
This section attempts to document the invariants that must hold to
49+
avoid races. These primarily deal with the state and blocked_task
50+
fields on packet_headers.
51+
52+
1. If the sender reads a some(task) out of blocked_task, then the task
53+
that is pointed there will remain live for any events that the sender
54+
might signal.
55+
56+
2. The sender may only read the blocked_task field if it first ensures
57+
that the packet's state field is blocked.
58+
4459
*/
4560

4661
import unsafe::{forget, reinterpret_cast, transmute};

branches/dist-snap/src/rt/rust_task.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,11 +678,11 @@ MUST_CHECK bool rust_task::wait_event(void **result) {
678678

679679
void
680680
rust_task::signal_event(void *event) {
681-
scoped_lock with(lifecycle_lock);
682-
683681
assert(task_state_blocked == state ||
684682
task_state_running == state);
685683

684+
scoped_lock with(lifecycle_lock);
685+
686686
this->event = event;
687687
event_reject = true;
688688
if(task_state_blocked == state) {

0 commit comments

Comments
 (0)