File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9
9
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10
- refs/heads/dist-snap: d8e9724fb1b14a415d922431a5bc74f937c9ff38
10
+ refs/heads/dist-snap: 86947e47ad057d50209cf8a022f088c22089433f
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -41,6 +41,21 @@ buffer that is carried along in the endpoint data structures.
41
41
42
42
FIXME (#3072) - This is still incomplete
43
43
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
+
44
59
*/
45
60
46
61
import unsafe:: { forget, reinterpret_cast, transmute} ;
Original file line number Diff line number Diff line change @@ -678,11 +678,11 @@ MUST_CHECK bool rust_task::wait_event(void **result) {
678
678
679
679
void
680
680
rust_task::signal_event (void *event) {
681
- scoped_lock with (lifecycle_lock);
682
-
683
681
assert (task_state_blocked == state ||
684
682
task_state_running == state);
685
683
684
+ scoped_lock with (lifecycle_lock);
685
+
686
686
this ->event = event;
687
687
event_reject = true ;
688
688
if (task_state_blocked == state) {
You can’t perform that action at this time.
0 commit comments