a random deadlock when fork() is called in a multithreaded process in debug
mode, and make PyOS_AfterFork() more robust.
main_thread = PyThread_get_thread_ident();
main_pid = getpid();
_PyImport_ReInitLock();
- PyThread_ReInitTLS();
#endif
}
+
+int
+_PyOS_IsMainThread(void)
+{
+#ifdef WITH_THREAD
+ return PyThread_get_thread_ident() == main_thread;
+#else
+ return 1;
+#endif
+}
+
+#ifdef MS_WINDOWS
+void *_PyOS_SigintEvent(void)
+{
+ /* Returns a manual-reset event which gets tripped whenever
+ SIGINT is received.
+
+ Python.h does not include windows.h so we do cannot use HANDLE
+ as the return type of this function. We use void* instead. */
+ return sigint_event;
+}
+#endif