-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wait for GC workers to exit using join handles
- Loading branch information
Showing
6 changed files
with
90 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//! This module defines types for supporting GC threads. | ||
/// This type is used for joining GC threads, i.e. waiting for GC threads to exit. | ||
/// | ||
/// This type is used for supporting forking. [`crate::MMTK::prepare_to_fork`] will block until | ||
/// all GC workers have exited so that the VM can safely call the `fork()` system call. If a VM | ||
/// never calls `fork()`, or calls `fork()` only for calling `exec()`, the VM can use | ||
/// [`UnimplementedGCThreadJoinHandle`] instead. | ||
pub trait GCThreadJoinHandle: Send { | ||
/// Block until the underlying native thread of the GC thread exited. | ||
fn join_native_thread(self); | ||
} | ||
|
||
/// An unimplemented [`GCThreadJoinHandle`]. Calling `join_native_thread` will panic. | ||
struct UnimplementedGCThreadJoinHandle; | ||
|
||
impl GCThreadJoinHandle for UnimplementedGCThreadJoinHandle { | ||
fn join_native_thread(self) { | ||
unimplemented!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters