[][src]Function stop_thread::kill_thread

pub unsafe fn kill_thread<T>(handle: JoinHandle<T>)
This is supported on Unix or Windows only.

Kills the thread using pthread_cancel or TerminateThread.

Unix

Safety

Only kills the thread if it has enabled cancellation, then performs cleanup. See man pthread_cancel for more information.

Windows

Uses u32::MAX as the exit code.

Safety

Forcibly and immediately stops the thread, without any cleanup. See https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread for more information.