Skip to content

Commit 9393131

Browse files
committed
rt: Add FIXMEs about races in rust_task
1 parent 0dfa141 commit 9393131

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/rt/rust_task.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ rust_task::yield(size_t time_in_us) {
278278
unblock();
279279
fail();
280280
}
281+
282+
// FIXME: If we are blocked, and get killed right here then we may never
283+
// know it.
284+
281285
yield_timer.reset_us(time_in_us);
282286

283287
// Return to the scheduler.
@@ -468,8 +472,11 @@ rust_task::die() {
468472

469473
void
470474
rust_task::unblock() {
471-
if (blocked())
475+
if (blocked()) {
476+
// FIXME: What if another thread unblocks the task between when
477+
// we checked and here?
472478
wakeup(cond);
479+
}
473480
}
474481

475482
rust_crate_cache *

0 commit comments

Comments
 (0)