You can use this solution worked for me.
And it is thread safe.
import time
from threading import Thread
from pyrvsignal import Signal
class MyThread(Thread):
    started = Signal()
    finished = Signal()
    def __init__(self, target, args):
        self.target = target
        self.args = args
        Thread.__init__(self)
    def run(self) -> None:
        self.started.emit()
        self.target(*self.args)
        self.finished.emit()
def do_my_work(details):
    print(f"Doing work: {details}")
    time.sleep(10)
def started_work():
    print("Started work")
    
def finished_work():
    print("Work finished")
thread = MyThread(target=do_my_work, args=("testing",))
thread.started.connect(started_work)
thread.finished.connect(finished_work)
thread.start()
Refer this - Notify threading events