int fd;
PY_TIMEOUT_T timeout_ms; /* timeout in microseconds */
int repeat;
- volatile int running;
+ int running;
PyInterpreterState *interp;
int exit;
/* released by parent thread when cancel request */
/* The only way out */
PyThread_release_lock(thread.cancel_event);
PyThread_release_lock(thread.join_event);
- thread.running = 0;
}
static void
}
/* Wait for thread to join */
PyThread_acquire_lock(thread.join_event, 1);
- assert(thread.running == 0);
PyThread_release_lock(thread.join_event);
+ thread.running = 0;
Py_CLEAR(thread.file);
}
thread.running = 1;
if (PyThread_start_new_thread(faulthandler_thread, NULL) == -1) {
thread.running = 0;
+ PyThread_release_lock(thread.join_event);
+ PyThread_release_lock(thread.cancel_event);
Py_CLEAR(thread.file);
PyErr_SetString(PyExc_RuntimeError,
"unable to start watchdog thread");