Lines Matching refs:thread

96     /* The main thread always holds this lock. It is only released when
97 faulthandler_thread() is interrupted before this thread exits, or at
100 /* released by child thread when joined */
102 } thread;
214 /* Get the state of the current thread: only call this function if the current
215 thread holds the GIL. Raise an exception on error. */
223 "unable to get the current thread state");
242 are thus delivered to the thread that caused the fault. Get the Python
243 thread state of the current thread.
245 PyThreadState_Get() doesn't give the state of the thread that caused the
246 fault if the thread released the GIL, and so this function cannot be
247 used. Read the thread specific storage (TSS) instead: call
625 st = PyThread_acquire_lock_timed(thread.cancel_event,
626 thread.timeout_us, 0);
628 PyThread_release_lock(thread.cancel_event);
634 _Py_write_noraise(thread.fd, thread.header, (int)thread.header_len);
636 errmsg = _Py_DumpTracebackThreads(thread.fd, thread.interp, NULL);
639 if (thread.exit)
641 } while (ok && thread.repeat);
644 PyThread_release_lock(thread.running);
651 if (!thread.cancel_event) {
656 PyThread_release_lock(thread.cancel_event);
658 /* Wait for thread to join */
659 PyThread_acquire_lock(thread.running, 1);
660 PyThread_release_lock(thread.running);
662 /* The main thread should always hold the cancel_event lock */
663 PyThread_acquire_lock(thread.cancel_event, 1);
665 Py_CLEAR(thread.file);
666 if (thread.header) {
667 PyMem_Free(thread.header);
668 thread.header = NULL;
748 if (!thread.running) {
749 thread.running = PyThread_allocate_lock();
750 if (!thread.running) {
754 if (!thread.cancel_event) {
755 thread.cancel_event = PyThread_allocate_lock();
756 if (!thread.cancel_event || !thread.running) {
761 the thread. */
762 PyThread_acquire_lock(thread.cancel_event, 1);
772 /* Cancel previous thread, if running */
776 Py_XSETREF(thread.file, file);
777 thread.fd = fd;
779 thread.timeout_us = (PY_TIMEOUT_T)timeout_us;
780 thread.repeat = repeat;
781 thread.interp = PyThreadState_GetInterpreter(tstate);
782 thread.exit = exit;
783 thread.header = header;
784 thread.header_len = header_len;
787 PyThread_acquire_lock(thread.running, 1);
790 PyThread_release_lock(thread.running);
791 Py_CLEAR(thread.file);
793 thread.header = NULL;
795 "unable to start watchdog thread");
847 Dump the traceback of the current thread, or of all threads if
848 thread.all_threads is true.
1092 Py_FatalError("in new thread");
1098 long thread;
1109 thread = PyThread_start_new_thread(faulthandler_fatal_error_thread, lock);
1110 if (thread == -1) {
1112 PyErr_SetString(PyExc_RuntimeError, "unable to start the thread");
1116 /* wait until the thread completes: it will never occur, since Py_FatalError()
1213 Py_VISIT(thread.file);
1252 "dump the traceback of the current thread, or of all threads "
1269 "traceback of the current thread, or of all threads if "
1283 "call Py_FatalError() in a new C thread.")},
1390 memset(&thread, 0, sizeof(thread));
1403 if (thread.cancel_event) {
1405 PyThread_release_lock(thread.cancel_event);
1406 PyThread_free_lock(thread.cancel_event);
1407 thread.cancel_event = NULL;
1409 if (thread.running) {
1410 PyThread_free_lock(thread.running);
1411 thread.running = NULL;