I'm a little bit lost in multithreading application I'm analysing. I supposed that function I'm trying to understand acts in main thread. To be sure I have placed enter and exit critical section code in it. The same critical section is also used in program startup (enter critical section) and termination (leave critical section).
Correct me if I'm wrong. If my function acts in main thread, critical section should allow to be entered. But it is not so - my functions just stops on entering critical section. According to my understanding this function acts in another thread.
Is my method correct for understanding which function acts in which thread?