-
-#ifdef WIN32
- static DWORD __current_thread_id = 0;
-
- int is_main_thread() {
- return (GetCurrentThreadId() == __current_thread_id);
- }
-
-#else /* !WIN32 */
-
- static pthread_t __current_thread_id = 0;
-
- int is_main_thread() {
- return (pthread_self() == __current_thread_id);
- }
-#endif
-