comparison Python/pythonrun.c @ 961:a31e07847063 legacy-trunk

New thread.c from Sjoerd, supports _exit_prog(). Use this in goaway() to avoid hanging in cleanup().
author Guido van Rossum <guido@python.org>
date Mon, 17 Aug 1992 08:59:08 +0000
parents cd40e3eebb49
children f3d5e2c3b9a3
comparison
equal deleted inserted replaced
960:7d3a053c6765 961:a31e07847063
359 abort(); 359 abort();
360 } 360 }
361 361
362 /* Clean up and exit */ 362 /* Clean up and exit */
363 363
364 #ifdef USE_THREAD
365 extern int threads_started;
366 #endif
367
364 void 368 void
365 goaway(sts) 369 goaway(sts)
366 int sts; 370 int sts;
367 { 371 {
368 flushline(); 372 flushline();
373 cleanup actions usually done (these are mostly for 377 cleanup actions usually done (these are mostly for
374 debugging anyway). */ 378 debugging anyway). */
375 379
376 (void) save_thread(); 380 (void) save_thread();
377 donecalls(); 381 donecalls();
378 exit_prog(sts); 382 if (threads_started)
383 _exit_prog(sts);
384 else
385 exit_prog(sts);
379 386
380 #else /* USE_THREAD */ 387 #else /* USE_THREAD */
381 388
382 /* XXX Call doneimport() before donecalls(), since donecalls() 389 /* XXX Call doneimport() before donecalls(), since donecalls()
383 calls wdone(), and doneimport() may close windows */ 390 calls wdone(), and doneimport() may close windows */