from ctypes import *
pthread = cdll.LoadLibrary("libpthread-2.15.so")
pthread.pthread_cancel(c_ulong(t.ident))
t - ваш объект Thread
.
. Читайте источник python (Modules/threadmodule.c
и Python/thread_pthread.h
), вы можете видеть, что Thread.ident
- это тип pthread_t
, поэтому вы может делать все, что pthread
может делать в использовании python libpthread
.