Fix minor thinkos in hv.c and pp_ctl.c. This is 5.004_55.
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index 4cbc677..0ffb04c 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -462,9 +462,13 @@ register struct op *op asm(stringify(OP_IN_REGISTER));
 #ifdef USE_THREADS
 #  define ERRSV (thr->errsv)
 #  define ERRHV (thr->errhv)
+#  define DEFSV *av_fetch(thr->threadsv, find_threadsv("_"), FALSE)
+#  define SAVE_DEFSV save_threadsv(find_threadsv("_"))
 #else
 #  define ERRSV GvSV(errgv)
 #  define ERRHV GvHV(errgv)
+#  define DEFSV GvSV(defgv)
+#  define SAVE_DEFSV SAVESPTR(GvSV(defgv))
 #endif /* USE_THREADS */
 
 #ifndef errno
@@ -1054,7 +1058,7 @@ union any {
 };
 
 #ifdef USE_THREADS
-#define ARGSproto struct thread *thr
+#define ARGSproto struct perl_thread *thr
 #else
 #define ARGSproto void
 #endif /* USE_THREADS */
@@ -1339,6 +1343,14 @@ typedef Sighandler_t Sigsave_t;
 # define RUNOPS_DEFAULT runops_standard
 #endif
 
+#ifdef MYMALLOC
+#  define MALLOC_INIT MUTEX_INIT(&malloc_mutex)
+#  define MALLOC_TERM MUTEX_DESTROY(&malloc_mutex)
+#else
+#  define MALLOC_INIT
+#  define MALLOC_TERM
+#endif
+
 /*
  * These need prototyping here because <proto.h> isn't
  * included until after runops is initialised.
@@ -1349,7 +1361,7 @@ int runops_standard _((void));
 int runops_debug _((void));
 #endif
 
-#define PER_THREAD_MAGICALS "123456789&`'+/.,\\\";^-%=|~:\001\005!@"
+#define THREADSV_NAMES "_123456789&`'+/.,\\\";^-%=|~:\001\005!@"
 
 /****************/
 /* Truly global */
@@ -1358,18 +1370,18 @@ int runops_debug _((void));
 /* global state */
 EXT PerlInterpreter *  curinterp;      /* currently running interpreter */
 #ifdef USE_THREADS
-EXT perl_key           thr_key;        /* For per-thread struct thread ptr */
+EXT perl_key           thr_key;        /* For per-thread struct perl_thread* */
 EXT perl_mutex         sv_mutex;       /* Mutex for allocating SVs in sv.c */
 EXT perl_mutex         malloc_mutex;   /* Mutex for malloc */
 EXT perl_mutex         eval_mutex;     /* Mutex for doeval */
 EXT perl_cond          eval_cond;      /* Condition variable for doeval */
-EXT struct thread *    eval_owner;     /* Owner thread for doeval */
+EXT struct perl_thread *       eval_owner;     /* Owner thread for doeval */
 EXT int                        nthreads;       /* Number of threads currently */
 EXT perl_mutex         threads_mutex;  /* Mutex for nthreads and thread list */
 EXT perl_cond          nthreads_cond;  /* Condition variable for nthreads */
-EXT char *             per_thread_magicals INIT(PER_THREAD_MAGICALS);
+EXT char *             threadsv_names INIT(THREADSV_NAMES);
 #ifdef FAKE_THREADS
-EXT struct thread *    thr;            /* Currently executing (fake) thread */
+EXT struct perl_thread *       thr;    /* Currently executing (fake) thread */
 #endif
 #endif /* USE_THREADS */
 
@@ -1955,7 +1967,7 @@ IEXT SV * Imess_sv;
 
 #ifdef USE_THREADS
 /* threads stuff */
-IEXT SV *      Ithrsv;         /* holds struct thread for main thread */
+IEXT SV *      Ithrsv;         /* holds struct perl_thread for main thread */
 #endif /* USE_THREADS */
 
 #undef IEXT