diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-02-02 15:51:39 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-02-02 15:51:39 +0000 |
commit | 940cb80d04d066d4fedfc4486ab57e435ee74514 (patch) | |
tree | 29bcb5cc4d0e30eb584990d09b0ee5b2ad73cc49 /perl.h | |
parent | 5330fa38cab061dceb2210e65e8eccfafbebc694 (diff) | |
download | perl-940cb80d04d066d4fedfc4486ab57e435ee74514.tar.gz |
Introduced thr->threadsvp and THREADSV() for faster per-thread
variables. Moved threadnum to a per-interpreter variable and
made dTHR and lock/unlock of sv_mutex bypass the get/lock unless
more than one thread may be running. Minor tweaks to Thread.xs.
p4raw-id: //depot/perl@453
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -471,8 +471,8 @@ Free_t Perl_free _((Malloc_t where)); #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("_")) +# define DEFSV THREADSV(0) +# define SAVE_DEFSV save_threadsv(0) #else # define ERRSV GvSV(errgv) # define ERRHV GvHV(errgv) @@ -1379,6 +1379,7 @@ int runops_standard _((void)); int runops_debug _((void)); #endif +/* _ (for $_) must be first in the following list (DEFSV requires it) */ #define THREADSV_NAMES "_123456789&`'+/.,\\\";^-%=|~:\001\005!@" /* VMS doesn't use environ array and NeXT has problems with crt0.o globals */ @@ -2035,12 +2036,12 @@ enum { * and queried under the protection of sv_mutex */ #define offer_nice_chunk(chunk, chunk_size) do { \ - MUTEX_LOCK(&sv_mutex); \ + LOCK_SV_MUTEX; \ if (!nice_chunk) { \ nice_chunk = (char*)(chunk); \ nice_chunk_size = (chunk_size); \ } \ - MUTEX_UNLOCK(&sv_mutex); \ + UNLOCK_SV_MUTEX; \ } while (0) |