This repository was archived by the owner on Feb 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Original file line number Diff line number Diff line change @@ -623,7 +623,6 @@ void slp_kill_tasks_with_stacks(PyThreadState *target_ts)
623
623
*/
624
624
if (target_ts == NULL && tasklet_list ) {
625
625
PyThreadState * ts ;
626
- PyObject * threadid_list = NULL ;
627
626
count = 0 ;
628
627
629
628
/* build a list of tasklets to be killed */
@@ -640,30 +639,9 @@ void slp_kill_tasks_with_stacks(PyThreadState *target_ts)
640
639
}
641
640
SLP_HEAD_UNLOCK ();
642
641
643
- /* get the list of thread ids */
644
- if (PyExc_TaskletExit )
645
- threadid_list = slp_getthreads (Py_None ); /* requires the HEAD lock */
646
-
647
642
/* kill the tasklets */
648
643
kill_pending (tasklet_list );
649
- /* kill the threads */
650
- if (threadid_list != NULL ) {
651
- Py_ssize_t i , len ;
652
- assert (PyList_CheckExact (threadid_list ));
653
- len = PyList_GET_SIZE (threadid_list );
654
- for (i = 0 ; i < len ; i ++ ) {
655
- long thread_id ;
656
- PyObject * item = PyList_GET_ITEM (threadid_list , i );
657
- assert (PyLong_CheckExact (item ));
658
- thread_id = PyLong_AsLong (item );
659
- if (thread_id != cts -> thread_id ) {
660
- /* requires the HEAD lock */
661
- PyThreadState_SetAsyncExc (thread_id , PyExc_TaskletExit );
662
- PyErr_Clear ();
663
- }
664
- }
665
- Py_DECREF (threadid_list );
666
- }
644
+
667
645
/* We must not release the GIL while we might hold the HEAD-lock.
668
646
* Otherwise another thread (usually the thread of the killed tasklet)
669
647
* could try to get the HEAD lock. The result would be a wonderful dead lock.
You can’t perform that action at this time.
0 commit comments