Skip to content

Commit c56ef31

Browse files
author
Vytautas Astrauskas
committed
Improve comments.
1 parent 331dbd1 commit c56ef31

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/shims/thread.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
3232

3333
let func_arg = this.read_immediate(arg)?;
3434

35+
// Note: the returned value is currently ignored (see the FIXME in
36+
// pthread_join below) because the Rust standard library does not use
37+
// it.
3538
let ret_place =
3639
this.allocate(this.layout_of(this.tcx.types.usize)?, MiriMemoryKind::Machine.into());
3740

src/thread.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ impl<'mir, 'tcx: 'mir> ThreadManager<'mir, 'tcx> {
358358
/// long as we can and switch only when we have to (the active thread was
359359
/// blocked, terminated, or has explicitly asked to be preempted).
360360
fn schedule(&mut self) -> InterpResult<'tcx, SchedulingAction> {
361+
// Check whether the thread has **just** terminated (`check_terminated`
362+
// checks whether the thread has popped all its stack and if yes, sets
363+
// the thread state to terminated.)
361364
if self.threads[self.active_thread].check_terminated() {
362365
// Check if we need to unblock any threads.
363366
for (i, thread) in self.threads.iter_enumerated_mut() {

0 commit comments

Comments
 (0)