Python/ceval.c
void
PyEval_ReInitThreads(void)
{
    _Py_IDENTIFIER(_after_fork);
    PyObject *threading, *result;
    PyThreadState *current_tstate = PyThreadState_GET();

    if (!gil_created())
        return;
    recreate_gil();
    pending_lock = PyThread_allocate_lock();
    take_gil(current_tstate);
    main_thread = PyThread_get_thread_ident();

    /* Update the threading module with the new state.
     */
    threading = PyMapping_GetItemString(current_tstate->interp->modules,
                                        "threading");
    if (threading == NULL) {
        /* threading not imported */
        PyErr_Clear();
        return;
    }
    result = _PyObject_CallMethodId(threading, &PyId__after_fork, NULL);
    if (result == NULL)
        PyErr_WriteUnraisable(threading);
    else
        Py_DECREF(result);
    Py_DECREF(threading);

    /* Destroy all threads except the current one */
    _PyThreadState_DeleteExcept(current_tstate);
}
/* This function is called from PyOS_AfterFork to destroy all threads which are
 * not running in the child process, and clear internal locks which might be
 * held by those threads. (This could also be done using pthread_atfork
 * mechanism, at least for the pthreads implementation.) */
This function is called from PyOS_AfterFork to destroy all threads which are
not running in the child process, and clear internal locks which might be
held by those threads. (This could also be done using pthread_atfork
mechanism, at least for the pthreads implementation.)
This function is called from PyOS_AfterFork to destroy all threads which are not running in the child process and clear internal locks which might be held by those threads . ( This could also be done using pthread_atfork mechanism at least for the pthreads implementation . )
void
PyEval_ReInitThreads(void)
{
    _Py_IDENTIFIER(_after_fork);
    PyObject *threading, *result;
    PyThreadState *current_tstate = PyThreadState_GET();
    if (!gil_created())
        return;
    recreate_gil();
    pending_lock = PyThread_allocate_lock();
    take_gil(current_tstate);
    main_thread = PyThread_get_thread_ident();
    threading = PyMapping_GetItemString(current_tstate->interp->modules,
                                        "threading");
    if (threading == NULL) {
        PyErr_Clear();
        return;
    }
    result = _PyObject_CallMethodId(threading, &PyId__after_fork, NULL);
    if (result == NULL)
        PyErr_WriteUnraisable(threading);
    else
        Py_DECREF(result);
    Py_DECREF(threading);
    _PyThreadState_DeleteExcept(current_tstate);
}
void PyEval_ReInitThreads ( void ) { _Py_IDENTIFIER ( _after_fork ) ; PyObject * threading , * result ; PyThreadState * current_tstate = PyThreadState_GET ( ) ; if ( ! gil_created ( ) ) return ; recreate_gil ( ) ; pending_lock = PyThread_allocate_lock ( ) ; take_gil ( current_tstate ) ; main_thread = PyThread_get_thread_ident ( ) ; threading = PyMapping_GetItemString ( current_tstate -> interp -> modules , " " ) ; if ( threading == NULL ) { PyErr_Clear ( ) ; return ; } result = _PyObject_CallMethodId ( threading , & PyId__after_fork , NULL ) ; if ( result == NULL ) PyErr_WriteUnraisable ( threading ) ; else Py_DECREF ( result ) ; Py_DECREF ( threading ) ; _PyThreadState_DeleteExcept ( current_tstate ) ; }
This function is called from PyOS_AfterFork to destroy all threads which are
 not running in the child process, and clear internal locks which might be
 held by those threads.
This function is called from PyOS_AfterFork to destroy all threads which are not running in the child process and clear internal locks which might be held by those threads .
/* Update the threading module with the new state.
     */ /* threading not imported */ /* Destroy all threads except the current one */