Skip to content

Commit

Permalink
Stackless issue python#81: don't raise TaskletExit in daemon threads …
Browse files Browse the repository at this point in the history
…during shutdown

Since issue python#81 Stackless 2.7 raises TaskletExit in daemon threads during interpreter shutdown.
This prevents later crashes (i.e. segfaults). In Python 3 this precautions are no longer required
and break the CPython test case test.test_threading.ThreadJoinOnShutdown.test_6_daemon_threads.
This changeset removes the code, that raises TaskletExit.
  • Loading branch information
Anselm Kruis committed Nov 6, 2016
1 parent 011078a commit 616a6ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Stackless/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ What's New in Stackless 3.X.X?
- https://bitbucket.org/stackless-dev/stackless/issues/81
Fix (crash) bugs during thread and interpreter shutdown.
If a thread dies, Stackless now really kills tasklets with C-state. During
interpreter shutdown, Stackless also kills daemon threads, if they execute
Python code or switch tasklets. This change avoids crashes during a later
shutdown stage.
interpreter shutdown, Stackless also kills daemon threads, if they switch
tasklets. This change avoids crashes during a later shutdown stage.

- https://bitbucket.org/stackless-dev/stackless/issues/92
If you run Stackless with the option '-v' (or set the environment variable
Expand Down
3 changes: 0 additions & 3 deletions Stackless/core/stacklesseval.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,6 @@ void slp_kill_tasks_with_stacks(PyThreadState *target_ts)
*/
count++;
kill_pending_current_main_and_watchdogs(ts);
/* It helps to inactivate threads reliably */
if (PyExc_TaskletExit)
PyThreadState_SetAsyncExc(ts->thread_id, PyExc_TaskletExit);
}
}
/* We must not release the GIL while we might hold the HEAD-lock.
Expand Down

0 comments on commit 616a6ba

Please sign in to comment.