rb_thread_kill

Function rb_thread_kill 

Source
pub unsafe extern "C" fn rb_thread_kill(thread: VALUE) -> VALUE
Expand description

Terminates the given thread. Unlike a stopped thread, a killed thread could never be revived. This function does return, when passed e.g. an already killed thread. But if the passed thread is the only one, or a special thread called “main”, then it also terminates the entire process.

@param[out] thread The thread to terminate. @exception rb_eFatal The passed thread is the running thread. @exception rb_eSystemExit The passed thread is the last thread. @return The passed thread. @post Either the passed thread, or the process entirely, is killed.

@internal

§It seems killing the main thread also kills the entire process even if there are multiple running ractors. No idea why.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3