Don't set the context to the running thread before
Artur Bergman [Thu, 11 Jul 2002 13:02:15 +0000 (13:02 +0000)]
we run destroy on the old, cures segfault on linux.

p4raw-id: //depot/perl@17481

ext/threads/threads.xs

index 4173299..8260e04 100755 (executable)
@@ -131,7 +131,6 @@ Perl_ithread_destruct (pTHX_ ithread* thread, const char *why)
            destroyperl = thread->interp;
            thread->interp = NULL;
        }
-       PERL_SET_CONTEXT(aTHX);
        MUTEX_UNLOCK(&thread->mutex);
        MUTEX_DESTROY(&thread->mutex);
         PerlMemShared_free(thread);
@@ -139,6 +138,7 @@ Perl_ithread_destruct (pTHX_ ithread* thread, const char *why)
            perl_destruct(destroyperl);
             perl_free(destroyperl);
        }
+       PERL_SET_CONTEXT(aTHX);
 }
 
 int