Thread hook function
I have two threads f1() and f2(), how can I make a function say g() called every time a thread is awakened to run? For example before thread f1() starts g() is called and returned and f1() runs, then when f2() is activated and f1() is put to sleep, g() is called before f2() runs, and so on…regardless whether the threads run concurrently or in parallel, I’m just interested in adding a hook function g at the thread activation point!