develooper Front page | perl.perl5.porters | Postings from April 2000

Re: -Dusethread woes

Thread Previous | Thread Next
From:
Doug MacEachern
Date:
April 21, 2000 13:08
Subject:
Re: -Dusethread woes
Message ID:
Pine.LNX.4.10.10004211314120.300-100000@mojo.covalent.net
On Fri, 14 Apr 2000, Gurusamy Sarathy wrote:

> On Fri, 14 Apr 2000 16:23:51 PDT, Doug MacEachern wrote:
> >i also had to define PERL_NO_GET_CONTEXT when building libperl.a for this
> >to work.
> 
> That looks like a bug somewhere.  PERL_CORE should already enable
> everything PERL_NO_GET_CONTEXT does.

seems the problem is that PERL_{GET,SET}_CONTEXT are using pthread
stuff, moving them inside #ifdef USE_THREADS fixes the problem for me.

--- thread.h~	Sat Mar 11 08:42:45 2000
+++ thread.h	Thu Apr 20 17:38:17 2000
@@ -229,18 +229,6 @@
     } STMT_END
 #endif /* JOIN */
 
-#ifndef PERL_GET_CONTEXT
-#  define PERL_GET_CONTEXT	pthread_getspecific(PL_thr_key)
-#endif
-
-#ifndef PERL_SET_CONTEXT
-#  define PERL_SET_CONTEXT(t) \
-    STMT_START {						\
-	if (pthread_setspecific(PL_thr_key, (void *)(t)))	\
-	    Perl_croak_nocontext("panic: pthread_setspecific");	\
-    } STMT_END
-#endif /* PERL_SET_CONTEXT */
-
 #ifndef INIT_THREADS
 #  ifdef NEED_PTHREAD_INIT
 #    define INIT_THREADS pthread_init()
@@ -263,6 +251,18 @@
 #endif /* THREAD_RET */
 
 #if defined(USE_THREADS)
+
+#ifndef PERL_GET_CONTEXT
+#  define PERL_GET_CONTEXT	pthread_getspecific(PL_thr_key)
+#endif
+
+#ifndef PERL_SET_CONTEXT
+#  define PERL_SET_CONTEXT(t) \
+    STMT_START {						\
+	if (pthread_setspecific(PL_thr_key, (void *)(t)))	\
+	    Perl_croak_nocontext("panic: pthread_setspecific");	\
+    } STMT_END
+#endif /* PERL_SET_CONTEXT */
 
 /* Accessor for per-thread SVs */
 #  define THREADSV(i) (thr->threadsvp[i])



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About