]> granicus.if.org Git - python/commitdiff
#4852: Remove dead code in every thread implementation, unused for many years.
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Tue, 23 Feb 2010 23:19:39 +0000 (23:19 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Tue, 23 Feb 2010 23:19:39 +0000 (23:19 +0000)
16 files changed:
Include/pythread.h
Modules/threadmodule.c
PC/os2emx/python27.def
PC/os2vacpp/python.def
Python/thread_atheos.h
Python/thread_beos.h
Python/thread_cthread.h
Python/thread_foobar.h
Python/thread_lwp.h
Python/thread_nt.h
Python/thread_os2.h
Python/thread_pth.h
Python/thread_pthread.h
Python/thread_sgi.h
Python/thread_solaris.h
Python/thread_wince.h

index b5a6ec38a6efda9608a739f11e432252a1d861bd..dfd61575ea1095ae37cded560954a07c5ec3b215 100644 (file)
@@ -2,9 +2,6 @@
 #ifndef Py_PYTHREAD_H
 #define Py_PYTHREAD_H
 
-#define NO_EXIT_PROG           /* don't define PyThread_exit_prog() */
-                               /* (the result is no use of signals on SGI) */
-
 typedef void *PyThread_type_lock;
 typedef void *PyThread_type_sema;
 
@@ -15,7 +12,6 @@ extern "C" {
 PyAPI_FUNC(void) PyThread_init_thread(void);
 PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *);
 PyAPI_FUNC(void) PyThread_exit_thread(void);
-PyAPI_FUNC(void) PyThread__PyThread_exit_thread(void);
 PyAPI_FUNC(long) PyThread_get_thread_ident(void);
 
 PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void);
@@ -28,11 +24,6 @@ PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock);
 PyAPI_FUNC(size_t) PyThread_get_stacksize(void);
 PyAPI_FUNC(int) PyThread_set_stacksize(size_t);
 
-#ifndef NO_EXIT_PROG
-PyAPI_FUNC(void) PyThread_exit_prog(int);
-PyAPI_FUNC(void) PyThread__PyThread_exit_prog(int);
-#endif
-
 /* Thread Local Storage (TLS) API */
 PyAPI_FUNC(int) PyThread_create_key(void);
 PyAPI_FUNC(void) PyThread_delete_key(int);
index c682af22ef23e51467d2a05a19d3d4f0a841d51b..1981ff6bb917c90d2a0c9e70b56ff90b9dd044e6 100644 (file)
@@ -558,18 +558,6 @@ Raise a KeyboardInterrupt in the main thread.\n\
 A subthread can use this function to interrupt the main thread."
 );
 
-#ifndef NO_EXIT_PROG
-static PyObject *
-thread_PyThread_exit_prog(PyObject *self, PyObject *args)
-{
-       int sts;
-       if (!PyArg_ParseTuple(args, "i:exit_prog", &sts))
-               return NULL;
-       Py_Exit(sts); /* Calls PyThread_exit_prog(sts) or _PyThread_exit_prog(sts) */
-       for (;;) { } /* Should not be reached */
-}
-#endif
-
 static lockobject *newlockobject(void);
 
 static PyObject *
@@ -703,10 +691,6 @@ static PyMethodDef thread_methods[] = {
        {"stack_size",          (PyCFunction)thread_stack_size,
                                METH_VARARGS,
                                stack_size_doc},
-#ifndef NO_EXIT_PROG
-       {"exit_prog",           (PyCFunction)thread_PyThread_exit_prog,
-        METH_VARARGS},
-#endif
        {NULL,                  NULL}           /* sentinel */
 };
 
index 7b728a99ca97dcdc63d5b58a5cb49377def42e67..d1c38dc1b790edbe0ce34a5eb60d443c8e09c47c 100644 (file)
@@ -1160,7 +1160,6 @@ EXPORTS
   "PyThread_delete_key"
   "PyThread_set_key_value"
   "PyThread_get_key_value"
-  "PyThread__exit_thread"
 
 ; From python27_s.lib(gcmodule)
 ;  "initgc"
index ba0dfd699bf01c582c236beb433fb793e82ecb69..e8064f3b2491d692a8d3913bf9d526c2435478c5 100644 (file)
@@ -368,7 +368,6 @@ EXPORTS
                PyThreadState_GetDict
                PyThreadState_New
                PyThreadState_Swap
-               PyThread__exit_thread
                PyThread_acquire_lock
                PyThread_allocate_lock
                PyThread_allocate_sema
index c9f5e23189f109ba1678a4022cbff2b72e8c3dbc..747a6a2f916f3d067dcb3a2d7371aac9a1edbc95 100644 (file)
@@ -128,17 +128,14 @@ long PyThread_get_thread_ident(void)
 }
 
 
-static void do_PyThread_exit_thread(int no_cleanup)
+void PyThread_exit_thread(void)
 {
        dprintf(("PyThread_exit_thread called\n"));
 
        /* Thread-safe way to read a variable without a mutex: */
        if (atomic_add(&thread_count, 0) == 0) {
                /* No threads around, so exit main(). */
-               if (no_cleanup)
-                       _exit(0);
-               else
-                       exit(0);
+               exit(0);
        } else {
                /* We're a thread */
                exit_thread(0);
@@ -146,44 +143,6 @@ static void do_PyThread_exit_thread(int no_cleanup)
 }
 
 
-void PyThread_exit_thread(void)
-{
-       do_PyThread_exit_thread(0);
-}
-
-
-void PyThread__exit_thread(void)
-{
-       do_PyThread_exit_thread(1);
-}
-
-
-#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
-
-       /* No need to do anything, the threads get torn down if main()exits. */
-       if (no_cleanup)
-               _exit(status);
-       else
-               exit(status);
-}
-
-
-void PyThread_exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 0);
-}
-
-
-void PyThread__exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 1);
-}
-#endif                         /* NO_EXIT_PROG */
-
-
 /*
  * Lock support.
  *
index 82f99ded36ee02f7f37a71b4c4f009a68dca7b54..d12d562f9db235616449a882a7cc8d2201416638 100644 (file)
@@ -144,7 +144,7 @@ long PyThread_get_thread_ident( void )
        return ( tid != B_NAME_NOT_FOUND ? tid : -1 );
 }
 
-static void do_PyThread_exit_thread( int no_cleanup )
+void PyThread_exit_thread( void )
 {
        int32 threads;
 
@@ -155,52 +155,13 @@ static void do_PyThread_exit_thread( int no_cleanup )
 
        if( threads == 0 ) {
                /* No threads around, so exit main(). */
-               if( no_cleanup ) {
-                       _exit(0);
-               } else {
-                       exit(0);
-               }
+               exit(0);
        } else {
                /* Oh, we're a thread, let's try to exit gracefully... */
                exit_thread( B_NO_ERROR );
        }
 }
 
-void PyThread_exit_thread( void )
-{
-       do_PyThread_exit_thread(0);
-}
-
-void PyThread__exit_thread( void )
-{
-       do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog( int status, int no_cleanup )
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
-
-       /* No need to do anything, the threads get torn down if main() exits. */
-
-       if (no_cleanup) {
-               _exit(status);
-       } else {
-               exit(status);
-       }
-}
-
-void PyThread_exit_prog( int status )
-{
-       do_PyThread_exit_prog(status, 0);
-}
-
-void PyThread__exit_prog( int status )
-{
-       do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
 /* ----------------------------------------------------------------------
  * Lock support.
  */
index ca776c63638b0d7105390e1b93c609728ede1ed3..71634122c0311de6ef97a57dd53950108282c4d7 100644 (file)
@@ -50,58 +50,14 @@ PyThread_get_thread_ident(void)
        return (long) cthread_self();
 }
 
-static void
-do_PyThread_exit_thread(int no_cleanup)
-{
-       dprintf(("PyThread_exit_thread called\n"));
-       if (!initialized)
-               if (no_cleanup)
-                       _exit(0);
-               else
-                       exit(0);
-       cthread_exit(0);
-}
-
 void
 PyThread_exit_thread(void)
 {
-       do_PyThread_exit_thread(0);
-}
-
-void
-PyThread__exit_thread(void)
-{
-       do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static
-void do_PyThread_exit_prog(int status, int no_cleanup)
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
+       dprintf(("PyThread_exit_thread called\n"));
        if (!initialized)
-               if (no_cleanup)
-                       _exit(status);
-               else
-                       exit(status);
-       if (no_cleanup)
-               _exit(status);
-       else
-               exit(status);
-}
-
-void
-PyThread_exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 0);
-}
-
-void
-PyThread__exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 1);
+               exit(0);
+       cthread_exit(0);
 }
-#endif /* NO_EXIT_PROG */
 
 /*
  * Lock support.
index 67491a167d61a84263fe97cf1240a93d5f841868..1b993d1e790b4951dac7bd758084e69663311a5c 100644 (file)
@@ -29,53 +29,13 @@ PyThread_get_thread_ident(void)
                PyThread_init_thread();
 }
 
-static
-void do_PyThread_exit_thread(int no_cleanup)
-{
-       dprintf(("PyThread_exit_thread called\n"));
-       if (!initialized)
-               if (no_cleanup)
-                       _exit(0);
-               else
-                       exit(0);
-}
-
 void
 PyThread_exit_thread(void)
 {
-       do_PyThread_exit_thread(0);
-}
-
-void
-PyThread__exit_thread(void)
-{
-       do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static
-void do_PyThread_exit_prog(int status, int no_cleanup)
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
+       dprintf(("PyThread_exit_thread called\n"));
        if (!initialized)
-               if (no_cleanup)
-                       _exit(status);
-               else
-                       exit(status);
-}
-
-void
-PyThread_exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 0);
-}
-
-void
-PyThread__exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 1);
+               exit(0);
 }
-#endif /* NO_EXIT_PROG */
 
 /*
  * Lock support.
index e93d65aa30dc680a5c45e6c457394adf0ecc61e8..93d82955561588dd73d6b2c07724a3318324f3a5 100644 (file)
@@ -47,50 +47,14 @@ long PyThread_get_thread_ident(void)
        return tid.thread_id;
 }
 
-static void do_PyThread_exit_thread(int no_cleanup)
+void PyThread_exit_thread(void)
 {
        dprintf(("PyThread_exit_thread called\n"));
        if (!initialized)
-               if (no_cleanup)
-                       _exit(0);
-               else
-                       exit(0);
+               exit(0);
        lwp_destroy(SELF);
 }
 
-void PyThread_exit_thread(void)
-{
-       do_PyThread_exit_thread(0);
-}
-
-void PyThread__exit_thread(void)
-{
-       do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
-       if (!initialized)
-               if (no_cleanup)
-                       _exit(status);
-               else
-                       exit(status);
-       pod_exit(status);
-}
-
-void PyThread_exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 0);
-}
-
-void PyThread__exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
 /*
  * Lock support.
  */
index 633fe4018fcbfc8f46af6321fb6289aee511e310..0c5d1929c309ffa1ebc61d5481c40ed45a3300a1 100644 (file)
@@ -203,16 +203,6 @@ PyThread_exit_thread(void)
 #endif
 }
 
-#ifndef NO_EXIT_PROG
-void
-PyThread_exit_prog(int status)
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
-       if (!initialized)
-               exit(status);
-}
-#endif /* NO_EXIT_PROG */
-
 /*
  * Lock support. It has too be implemented as semaphores.
  * I [Dag] tried to implement it with mutex but I could find a way to
index 12eeed51c46b06aa1dd9e3748c1a1421721e0866..eee8de6337de2a668a4f5eb1003875d111013d85 100644 (file)
@@ -68,56 +68,16 @@ PyThread_get_thread_ident(void)
 #endif
 }
 
-static void
-do_PyThread_exit_thread(int no_cleanup)
+void
+PyThread_exit_thread(void)
 {
        dprintf(("%ld: PyThread_exit_thread called\n",
                 PyThread_get_thread_ident()));
        if (!initialized)
-               if (no_cleanup)
-                       _exit(0);
-               else
-                       exit(0);
+               exit(0);
        _endthread();
 }
 
-void 
-PyThread_exit_thread(void)
-{
-       do_PyThread_exit_thread(0);
-}
-
-void 
-PyThread__exit_thread(void)
-{
-       do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void 
-do_PyThread_exit_prog(int status, int no_cleanup)
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
-       if (!initialized)
-               if (no_cleanup)
-                       _exit(status);
-               else
-                       exit(status);
-}
-
-void 
-PyThread_exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 0);
-}
-
-void 
-PyThread__exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
 /*
  * Lock support.  This is implemented with an event semaphore and critical
  * sections to make it behave more like a posix mutex than its OS/2 
index 8c7dbe925702ba94cb32aba987e8ad565d378b18..f11e4848d9c7fa777598f6f7df7581fd08db70a1 100644 (file)
@@ -74,49 +74,14 @@ long PyThread_get_thread_ident(void)
        return (long) *(long *) &threadid;
 }
 
-static void do_PyThread_exit_thread(int no_cleanup)
+void PyThread_exit_thread(void)
 {
        dprintf(("PyThread_exit_thread called\n"));
        if (!initialized) {
-               if (no_cleanup)
-                       _exit(0);
-               else
-                       exit(0);
+               exit(0);
        }
 }
 
-void PyThread_exit_thread(void)
-{
-       do_PyThread_exit_thread(0);
-}
-
-void PyThread__exit_thread(void)
-{
-       do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
-       if (!initialized)
-               if (no_cleanup)
-                       _exit(status);
-               else
-                       exit(status);
-}
-
-void PyThread_exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 0);
-}
-
-void PyThread__exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
 /*
  * Lock support.
  */
index 60d2fb216eb0793849bb36b2b8cf0c38a19c7109..4305a198badba0ba8af9bfe8ce28e3d65f4ada06 100644 (file)
@@ -225,55 +225,15 @@ PyThread_get_thread_ident(void)
 #endif
 }
 
-static void 
-do_PyThread_exit_thread(int no_cleanup)
+void 
+PyThread_exit_thread(void)
 {
        dprintf(("PyThread_exit_thread called\n"));
        if (!initialized) {
-               if (no_cleanup)
-                       _exit(0);
-               else
-                       exit(0);
+               exit(0);
        }
 }
 
-void 
-PyThread_exit_thread(void)
-{
-       do_PyThread_exit_thread(0);
-}
-
-void 
-PyThread__exit_thread(void)
-{
-       do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void 
-do_PyThread_exit_prog(int status, int no_cleanup)
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
-       if (!initialized)
-               if (no_cleanup)
-                       _exit(status);
-               else
-                       exit(status);
-}
-
-void 
-PyThread_exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 0);
-}
-
-void 
-PyThread__exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
 #ifdef USE_SEMAPHORES
 
 /*
index 234665848b7f9b4db162e3763e05abbf1bf3a286..4f4b210a2810595da70f0098443ab55fbc1b8435 100644 (file)
@@ -17,9 +17,6 @@ static ulock_t wait_lock;     /* lock used to wait for other threads */
 static int waiting_for_threads;        /* protected by count_lock */
 static int nthreads;           /* protected by count_lock */
 static int exit_status;
-#ifndef NO_EXIT_PROG
-static int do_exit;            /* indicates that the program is to exit */
-#endif
 static int exiting;            /* we're already exiting (for maybe_exit) */
 static pid_t my_pid;           /* PID of main thread */
 static struct pidlist {
@@ -27,53 +24,11 @@ static struct pidlist {
        pid_t child;
 } pidlist[MAXPROC];    /* PIDs of other threads; protected by count_lock */
 static int maxpidindex;                /* # of PIDs in pidlist */
-
-#ifndef NO_EXIT_PROG
-/*
- * This routine is called as a signal handler when another thread
- * exits.  When that happens, we must see whether we have to exit as
- * well (because of an PyThread_exit_prog()) or whether we should continue on.
- */
-static void exit_sig(void)
-{
-       d2printf(("exit_sig called\n"));
-       if (exiting && getpid() == my_pid) {
-               d2printf(("already exiting\n"));
-               return;
-       }
-       if (do_exit) {
-               d2printf(("exiting in exit_sig\n"));
-#ifdef Py_DEBUG
-               if ((thread_debug & 8) == 0)
-                       thread_debug &= ~1; /* don't produce debug messages */
-#endif
-               PyThread_exit_thread();
-       }
-}
-
-/*
- * This routine is called when a process calls exit().  If that wasn't
- * done from the library, we do as if an PyThread_exit_prog() was intended.
- */
-static void maybe_exit(void)
-{
-       dprintf(("maybe_exit called\n"));
-       if (exiting) {
-               dprintf(("already exiting\n"));
-               return;
-       }
-       PyThread_exit_prog(0);
-}
-#endif /* NO_EXIT_PROG */
-
 /*
  * Initialization.
  */
 static void PyThread__init_thread(void)
 {
-#ifndef NO_EXIT_PROG
-       struct sigaction s;
-#endif /* NO_EXIT_PROG */
 #ifdef USE_DL
        long addr, size;
 #endif /* USE_DL */
@@ -93,16 +48,6 @@ static void PyThread__init_thread(void)
        if (usconfig(CONF_INITUSERS, 16) < 0)
                perror("usconfig - CONF_INITUSERS");
        my_pid = getpid();      /* so that we know which is the main thread */
-#ifndef NO_EXIT_PROG
-       atexit(maybe_exit);
-       s.sa_handler = exit_sig;
-       sigemptyset(&s.sa_mask);
-       /*sigaddset(&s.sa_mask, SIGUSR1);*/
-       s.sa_flags = 0;
-       sigaction(SIGUSR1, &s, 0);
-       if (prctl(PR_SETEXITSIG, SIGUSR1) < 0)
-               perror("prctl - PR_SETEXITSIG");
-#endif /* NO_EXIT_PROG */
        if (usconfig(CONF_ARENATYPE, US_SHAREDONLY) < 0)
                perror("usconfig - CONF_ARENATYPE");
        usconfig(CONF_LOCKTYPE, US_DEBUG); /* XXX */
@@ -227,46 +172,24 @@ long PyThread_get_thread_ident(void)
        return getpid();
 }
 
-static void do_PyThread_exit_thread(int no_cleanup)
+void PyThread_exit_thread(void)
 {
        dprintf(("PyThread_exit_thread called\n"));
        if (!initialized)
-               if (no_cleanup)
-                       _exit(0);
-               else
-                       exit(0);
+               exit(0);
        if (ussetlock(count_lock) < 0)
                perror("ussetlock (count_lock)");
        nthreads--;
        if (getpid() == my_pid) {
                /* main thread; wait for other threads to exit */
                exiting = 1;
-#ifndef NO_EXIT_PROG
-               if (do_exit) {
-                       int i;
-
-                       /* notify other threads */
-                       clean_threads();
-                       if (nthreads >= 0) {
-                               dprintf(("kill other threads\n"));
-                               for (i = 0; i < maxpidindex; i++)
-                                       if (pidlist[i].child > 0)
-                                               (void) kill(pidlist[i].child,
-                                                           SIGKILL);
-                               _exit(exit_status);
-                       }
-               }
-#endif /* NO_EXIT_PROG */
                waiting_for_threads = 1;
                if (ussetlock(wait_lock) < 0)
                        perror("ussetlock (wait_lock)");
                for (;;) {
                        if (nthreads < 0) {
                                dprintf(("really exit (%d)\n", exit_status));
-                               if (no_cleanup)
-                                       _exit(exit_status);
-                               else
-                                       exit(exit_status);
+                               exit(exit_status);
                        }
                        if (usunsetlock(count_lock) < 0)
                                perror("usunsetlock (count_lock)");
@@ -283,50 +206,11 @@ static void do_PyThread_exit_thread(int no_cleanup)
                if (usunsetlock(wait_lock) < 0)
                        perror("usunsetlock (wait_lock)");
        }
-#ifndef NO_EXIT_PROG
-       else if (do_exit)
-               (void) kill(my_pid, SIGUSR1);
-#endif /* NO_EXIT_PROG */
        if (usunsetlock(count_lock) < 0)
                perror("usunsetlock (count_lock)");
        _exit(0);
 }
 
-void PyThread_exit_thread(void)
-{
-       do_PyThread_exit_thread(0);
-}
-
-void PyThread__exit_thread(void)
-{
-       do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
-       if (!initialized)
-               if (no_cleanup)
-                       _exit(status);
-               else
-                       exit(status);
-       do_exit = 1;
-       exit_status = status;
-       do_PyThread_exit_thread(no_cleanup);
-}
-
-void PyThread_exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 0);
-}
-
-void PyThread__exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 1);
-}
-#endif /* NO_EXIT_PROG */
-
 /*
  * Lock support.
  */
index ff3e6f3591c778963f6db42814261ab4551e977c..59ca0025a70538055299200ce68e5779985f7743 100644 (file)
@@ -64,58 +64,14 @@ PyThread_get_thread_ident(void)
        return thr_self();
 }
 
-static void 
-do_PyThread_exit_thread(int no_cleanup)
-{
-       dprintf(("PyThread_exit_thread called\n"));
-       if (!initialized)
-               if (no_cleanup)
-                       _exit(0);
-               else
-                       exit(0);
-       thr_exit(0);
-}
-
 void 
 PyThread_exit_thread(void)
 {
-       do_PyThread_exit_thread(0);
-}
-
-void 
-PyThread__exit_thread(void)
-{
-       do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void 
-do_PyThread_exit_prog(int status, int no_cleanup)
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
+       dprintf(("PyThread_exit_thread called\n"));
        if (!initialized)
-               if (no_cleanup)
-                       _exit(status);
-               else
-                       exit(status);
-       if (no_cleanup)
-               _exit(status);
-       else
-               exit(status);
-}
-
-void 
-PyThread_exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 0);
-}
-
-void 
-PyThread__exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 1);
+               exit(0);
+       thr_exit(0);
 }
-#endif /* NO_EXIT_PROG */
 
 /*
  * Lock support.
index e16f5d14155d387a84a15453a5cb2e2e6802f0b3..f8cf2cf9372c4fbe7dc1b09412d983ed1639c11b 100644 (file)
@@ -53,48 +53,13 @@ long PyThread_get_thread_ident(void)
        return GetCurrentThreadId();
 }
 
-static void do_PyThread_exit_thread(int no_cleanup)
-{
-       dprintf(("%ld: do_PyThread_exit_thread called\n", PyThread_get_thread_ident()));
-       if (!initialized)
-               if (no_cleanup)
-                       exit(0); /* XXX - was _exit()!! */
-               else
-                       exit(0);
-       _endthread();
-}
-
 void PyThread_exit_thread(void)
 {
-       do_PyThread_exit_thread(0);
-}
-
-void PyThread__exit_thread(void)
-{
-       do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
-{
-       dprintf(("PyThread_exit_prog(%d) called\n", status));
+       dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident()));
        if (!initialized)
-               if (no_cleanup)
-                       _exit(status);
-               else
-                       exit(status);
-}
-
-void PyThread_exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 0);
-}
-
-void PyThread__exit_prog(int status)
-{
-       do_PyThread_exit_prog(status, 1);
+               exit(0);
+       _endthread();
 }
-#endif /* NO_EXIT_PROG */
 
 /*
  * Lock support. It has to be implemented using Mutexes, as