thread-suspend

Name

thread-suspend -- Suspend a thread.

Type: function

Synopsis

thread-suspend( thread, );

Arguments

thread

An instance of <thread>

Description

Increments the suspend count of the given thread. This makes the thread ineligible for execution until a corresponding thread-resume is invoked.

If thread is the current thread, this procedure does not return until the corresponding thread-resume is invoked.

If thread is another, currently running, thread (i.e., in a SMP context), this procedure blocks until the target thread has stopped running (which should be fairly soon). [1]

Notes

[1]

However, if the target thread is blocked indefinitely in the OS kernel, e.g., on an NFS page fault and the server is down, then this procedure may block indefinitely waiting for the target to acknowledge the halt at a safe point. Hence, we will need to provide a timeoutable version as well.