Issue #1856: Avoid crashes and lockups when daemon threads run while the
interpreter is shutting down; instead, these threads are now killed when
they try to take the GIL.
diff --git a/Include/pythonrun.h b/Include/pythonrun.h
index bbcae73..00b4972 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -214,6 +214,8 @@
 PyAPI_FUNC(void) PyFloat_Fini(void);
 PyAPI_FUNC(void) PyOS_FiniInterrupts(void);
 PyAPI_FUNC(void) _PyGC_Fini(void);
+
+PyAPI_DATA(PyThreadState *) _Py_Finalizing;
 #endif
 
 /* Stuff with no proper home (yet) */