mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
New thread.c from Sjoerd, supports _exit_prog(). Use this in goaway()
to avoid hanging in cleanup().
This commit is contained in:
parent
0297512a08
commit
f9f2e82fca
5 changed files with 253 additions and 92 deletions
|
@ -31,6 +31,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
#include "thread.h"
|
||||
|
||||
int threads_started = 0;
|
||||
|
||||
object *ThreadError;
|
||||
|
||||
|
||||
|
@ -177,6 +179,8 @@ t_bootstrap(args_raw)
|
|||
object *args = (object *) args_raw;
|
||||
object *func, *arg, *res;
|
||||
|
||||
threads_started++;
|
||||
|
||||
restore_thread((void *)NULL);
|
||||
func = gettupleitem(args, 0);
|
||||
arg = gettupleitem(args, 1);
|
||||
|
@ -230,7 +234,7 @@ thread_exit_prog(self, args)
|
|||
int sts;
|
||||
if (!getargs(args, "i", &sts))
|
||||
return NULL;
|
||||
goaway(sts);
|
||||
goaway(sts); /* Calls exit_prog(sts) or _exit_prog(sts) */
|
||||
for (;;) { } /* Should not be reached */
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue