Lines Matching refs:test_c_thread
4519 test_c_thread_t *test_c_thread = data; in temporary_c_thread() local
4523 PyThread_release_lock(test_c_thread->start_event); in temporary_c_thread()
4528 res = PyObject_CallNoArgs(test_c_thread->callback); in temporary_c_thread()
4529 Py_CLEAR(test_c_thread->callback); in temporary_c_thread()
4541 PyThread_release_lock(test_c_thread->exit_event); in temporary_c_thread()
4544 static test_c_thread_t test_c_thread; variable
4558 test_c_thread.start_event = PyThread_allocate_lock(); in call_in_temporary_c_thread()
4559 test_c_thread.exit_event = PyThread_allocate_lock(); in call_in_temporary_c_thread()
4560 test_c_thread.callback = NULL; in call_in_temporary_c_thread()
4561 if (!test_c_thread.start_event || !test_c_thread.exit_event) { in call_in_temporary_c_thread()
4566 test_c_thread.callback = Py_NewRef(callback); in call_in_temporary_c_thread()
4568 PyThread_acquire_lock(test_c_thread.start_event, 1); in call_in_temporary_c_thread()
4569 PyThread_acquire_lock(test_c_thread.exit_event, 1); in call_in_temporary_c_thread()
4571 thread = PyThread_start_new_thread(temporary_c_thread, &test_c_thread); in call_in_temporary_c_thread()
4574 PyThread_release_lock(test_c_thread.start_event); in call_in_temporary_c_thread()
4575 PyThread_release_lock(test_c_thread.exit_event); in call_in_temporary_c_thread()
4579 PyThread_acquire_lock(test_c_thread.start_event, 1); in call_in_temporary_c_thread()
4580 PyThread_release_lock(test_c_thread.start_event); in call_in_temporary_c_thread()
4587 PyThread_acquire_lock(test_c_thread.exit_event, 1); in call_in_temporary_c_thread()
4588 PyThread_release_lock(test_c_thread.exit_event); in call_in_temporary_c_thread()
4594 Py_CLEAR(test_c_thread.callback); in call_in_temporary_c_thread()
4595 if (test_c_thread.start_event) { in call_in_temporary_c_thread()
4596 PyThread_free_lock(test_c_thread.start_event); in call_in_temporary_c_thread()
4597 test_c_thread.start_event = NULL; in call_in_temporary_c_thread()
4599 if (test_c_thread.exit_event) { in call_in_temporary_c_thread()
4600 PyThread_free_lock(test_c_thread.exit_event); in call_in_temporary_c_thread()
4601 test_c_thread.exit_event = NULL; in call_in_temporary_c_thread()
4610 PyThread_acquire_lock(test_c_thread.exit_event, 1); in join_temporary_c_thread()
4611 PyThread_release_lock(test_c_thread.exit_event); in join_temporary_c_thread()
4613 Py_CLEAR(test_c_thread.callback); in join_temporary_c_thread()
4614 PyThread_free_lock(test_c_thread.start_event); in join_temporary_c_thread()
4615 test_c_thread.start_event = NULL; in join_temporary_c_thread()
4616 PyThread_free_lock(test_c_thread.exit_event); in join_temporary_c_thread()
4617 test_c_thread.exit_event = NULL; in join_temporary_c_thread()