Mysql: Kill Process

MySQL implements KILL by setting a THD::killed flag inside the thread's descriptor. The target thread checks this flag at certain interrupt points:

: Use KILL QUERY first, then wait for thread to disappear. mysql kill process