File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: c424b7f847bbec50d01b00a89e044d80b8eb59f8
5
+ refs/heads/try: 5d625af9f944c7b6567c443a6f796e30dbb01bf2
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ rust_task::kill() {
248
248
killed = true ;
249
249
// Unblock the task so it can unwind.
250
250
251
- if (blocked ()) {
251
+ if (blocked () && must_fail_from_being_killed_unlocked () ) {
252
252
wakeup (cond);
253
253
}
254
254
@@ -648,11 +648,13 @@ rust_task::on_rust_stack() {
648
648
649
649
void
650
650
rust_task::inhibit_kill () {
651
+ scoped_lock with (kill_lock);
651
652
disallow_kill = true ;
652
653
}
653
654
654
655
void
655
656
rust_task::allow_kill () {
657
+ scoped_lock with (kill_lock);
656
658
disallow_kill = false ;
657
659
}
658
660
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ rust_task : public kernel_owned<rust_task>, rust_cond
149
149
rust_cond *cond;
150
150
const char *cond_name;
151
151
152
- // Protects the killed flag
152
+ // Protects the killed flag, disallow_kill flag, reentered_rust_stack
153
153
lock_and_signal kill_lock;
154
154
// Indicates that the task was killed and needs to unwind
155
155
bool killed;
@@ -372,7 +372,10 @@ rust_task::call_on_rust_stack(void *args, void *fn_ptr) {
372
372
assert (next_rust_sp);
373
373
374
374
bool had_reentered_rust_stack = reentered_rust_stack;
375
- reentered_rust_stack = true ;
375
+ {
376
+ scoped_lock with (kill_lock);
377
+ reentered_rust_stack = true ;
378
+ }
376
379
377
380
uintptr_t prev_c_sp = next_c_sp;
378
381
next_c_sp = get_sp ();
@@ -384,7 +387,10 @@ rust_task::call_on_rust_stack(void *args, void *fn_ptr) {
384
387
__morestack (args, fn_ptr, sp);
385
388
386
389
next_c_sp = prev_c_sp;
387
- reentered_rust_stack = had_reentered_rust_stack;
390
+ {
391
+ scoped_lock with (kill_lock);
392
+ reentered_rust_stack = had_reentered_rust_stack;
393
+ }
388
394
}
389
395
390
396
inline void
You can’t perform that action at this time.
0 commit comments