I am trying to start a thread using python threading module. I want to kill this newly created thread under certain conditions. I have written below code snippet but this seems to hang and process never returns
from threading import Thread
import time
import os, signal
def sum():
print("ada")
time.sleep(5)
print("ada1")
current = Thread(target=sum)
current.start()
current.join()
cur_pid = os.getpid()
print(cur_pid)
os.kill(cur_pid, signal.SIGSTOP)
print(current)