Make Perl_ithread_self() a bit more helpful when
Jarkko Hietaniemi [Mon, 19 May 2003 04:47:53 +0000 (04:47 +0000)]
finding the thread fails (suggested by Stas in
perl-ithreads Mar 01)

p4raw-id: //depot/perl@19563

ext/threads/threads.xs

index 4e34a40..994fd2b 100755 (executable)
@@ -532,7 +532,10 @@ Perl_ithread_self (pTHX_ SV *obj, char* Class)
 #else
     PERL_THREAD_GETSPECIFIC(self_key,thread);
 #endif
-    return ithread_to_SV(aTHX_ obj, thread, Class, TRUE);
+   if (thread)
+       return ithread_to_SV(aTHX_ obj, thread, Class, TRUE);
+   else
+       Perl_croak(aTHX_ "panic: cannot find thread data");
 }
 
 /*