summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-03-28 18:40:44 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-03-28 18:40:44 +0000
commit11343788cbaaede18e3146b5219d2fbdaeaf516e (patch)
treeef2be09ece0508b3408a222a86980d39e20bcd42 /util.c
parenta4f68e9b64464684b732bc17fd65ed4a1aa4708c (diff)
downloadperl-11343788cbaaede18e3146b5219d2fbdaeaf516e.tar.gz
Initial 3-way merge from (5.001m, thr1m, 5.003) plus fixups.
p4raw-id: //depot/thrperl@4
Diffstat (limited to 'util.c')
-rw-r--r--util.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/util.c b/util.c
index a11d98fe61..ef5c8460a9 100644
--- a/util.c
+++ b/util.c
@@ -885,6 +885,7 @@ mess(pat, args)
va_list *args;
#endif
{
+ dTHR;
char *s;
char *s_start;
SV *tmpstr;
@@ -960,6 +961,7 @@ croak(pat, va_alist)
va_dcl
#endif
{
+ dTHR;
va_list args;
char *message;
HV *stash;
@@ -973,6 +975,9 @@ croak(pat, va_alist)
#endif
message = mess(pat, &args);
va_end(args);
+#ifdef USE_THREADS
+ DEBUG_L(fprintf(stderr, "croak: 0x%lx %s", (unsigned long) thr, message));
+#endif /* USE_THREADS */
if (diehook && (cv = sv_2cv(diehook, &stash, &gv, 0)) && !CvDEPTH(cv)) {
dSP;
@@ -1030,6 +1035,7 @@ warn(pat,va_alist)
va_end(args);
if (warnhook && (cv = sv_2cv(warnhook, &stash, &gv, 0)) && !CvDEPTH(cv)) {
+ dTHR;
dSP;
PUSHMARK(sp);
@@ -1810,3 +1816,17 @@ I32 *retlen;
*retlen = s - start;
return retval;
}
+
+#ifdef USE_THREADS
+#ifdef OLD_PTHREADS_API
+struct thread *
+getTHR _((void))
+{
+ pthread_addr_t t;
+
+ if (pthread_getspecific(thr_key, &t))
+ croak("panic: pthread_getspecific");
+ return (struct thread *) t;
+}
+#endif /* OLD_PTHREADS_API */
+#endif /* USE_THREADS */