October 15th, 2012, 05:44 AM
I would like to know if a procedure or function is been executed in a thread different from the main thread, or to get some thread id that I can compare and know this information.
Do any one have a clue how to do that?
October 15th, 2012, 07:02 AM
In Windows environment you can use Windows API GetCurrentThreadId. It returns the id of the thread that the call was done in. If you store the main thread id somewhere, you can use the result of GetCurrentThreadId and compare it to the stored main thread id.
October 15th, 2012, 07:23 AM
Thanks a lot Luthfi, your suggestion works well.