From fe53aa5bafbad898597f77488a12ad889fba4485 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 19 May 2003 04:47:53 +0000 Subject: [PATCH] Make Perl_ithread_self() a bit more helpful when finding the thread fails (suggested by Stas in perl-ithreads Mar 01) p4raw-id: //depot/perl@19563 --- ext/threads/threads.xs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs index 4e34a40..994fd2b 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -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"); } /* -- 2.7.4