Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 5b2c817

Browse files
author
Anselm Kruis
committed
merge 3.3-slp (Stackless #120, fix grafting error)
2 parents 7f5b617 + ae1d0a4 commit 5b2c817

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

Stackless/core/stacklesseval.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,6 @@ void slp_kill_tasks_with_stacks(PyThreadState *target_ts)
623623
*/
624624
if (target_ts == NULL && tasklet_list) {
625625
PyThreadState *ts;
626-
PyObject *threadid_list = NULL;
627626
count = 0;
628627

629628
/* build a list of tasklets to be killed */
@@ -640,30 +639,9 @@ void slp_kill_tasks_with_stacks(PyThreadState *target_ts)
640639
}
641640
SLP_HEAD_UNLOCK();
642641

643-
/* get the list of thread ids */
644-
if (PyExc_TaskletExit)
645-
threadid_list = slp_getthreads(Py_None); /* requires the HEAD lock */
646-
647642
/* kill the tasklets */
648643
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+
667645
/* We must not release the GIL while we might hold the HEAD-lock.
668646
* Otherwise another thread (usually the thread of the killed tasklet)
669647
* could try to get the HEAD lock. The result would be a wonderful dead lock.

0 commit comments

Comments
 (0)