@@ -12,23 +12,25 @@ pub enum GCThreadContext<VM: VMBinding> {
12
12
/// VM-specific methods for garbage collection.
13
13
pub trait Collection < VM : VMBinding > {
14
14
/// Stop all the mutator threads. MMTk calls this method when it requires all the mutator to yield for a GC.
15
- /// This method is called by a single thread in MMTk (the GC controller).
16
15
/// This method should not return until all the threads are yielded.
17
16
/// The actual thread synchronization mechanism is up to the VM, and MMTk does not make assumptions on that.
18
17
/// MMTk provides a callback function and expects the binding to use the callback for each mutator when it
19
18
/// is ready for stack scanning. Usually a stack can be scanned as soon as the thread stops in the yieldpoint.
20
19
///
21
20
/// Arguments:
22
- /// * `tls`: The thread pointer for the GC controller/coordinator .
21
+ /// * `tls`: The thread pointer for the GC worker .
23
22
/// * `mutator_visitor`: A callback. Call it with a mutator as argument to notify MMTk that the mutator is ready to be scanned.
24
23
fn stop_all_mutators < F > ( tls : VMWorkerThread , mutator_visitor : F )
25
24
where
26
25
F : FnMut ( & ' static mut Mutator < VM > ) ;
27
26
28
27
/// Resume all the mutator threads, the opposite of the above. When a GC is finished, MMTk calls this method.
29
28
///
29
+ /// This method may not be called by the same GC thread that called `stop_all_mutators`.
30
+ ///
30
31
/// Arguments:
31
- /// * `tls`: The thread pointer for the GC controller/coordinator.
32
+ /// * `tls`: The thread pointer for the GC worker. Currently it is the tls of the embedded `GCWorker` instance
33
+ /// of the coordinator thread, but it is subject to change, and should not be depended on.
32
34
fn resume_mutators ( tls : VMWorkerThread ) ;
33
35
34
36
/// Block the current thread for GC. This is called when an allocation request cannot be fulfilled and a GC
0 commit comments