summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-02 15:51:39 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-02 15:51:39 +0000
commit940cb80d04d066d4fedfc4486ab57e435ee74514 (patch)
tree29bcb5cc4d0e30eb584990d09b0ee5b2ad73cc49 /sv.c
parent5330fa38cab061dceb2210e65e8eccfafbebc694 (diff)
downloadperl-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 'sv.c')
-rw-r--r--sv.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/sv.c b/sv.c
index d6c10391e3..2ed06cd672 100644
--- a/sv.c
+++ b/sv.c
@@ -65,18 +65,18 @@ typedef void (*SVFUNC) _((SV*));
#define new_SV(p) \
do { \
- MUTEX_LOCK(&sv_mutex); \
+ LOCK_SV_MUTEX; \
(p) = (SV*)safemalloc(sizeof(SV)); \
reg_add(p); \
- MUTEX_UNLOCK(&sv_mutex); \
+ UNLOCK_SV_MUTEX; \
} while (0)
#define del_SV(p) \
do { \
- MUTEX_LOCK(&sv_mutex); \
+ LOCK_SV_MUTEX; \
reg_remove(p); \
free((char*)(p)); \
- MUTEX_UNLOCK(&sv_mutex); \
+ UNLOCK_SV_MUTEX; \
} while (0)
static SV **registry;
@@ -183,24 +183,24 @@ U32 flags;
++sv_count; \
} while (0)
-#define new_SV(p) do { \
- MUTEX_LOCK(&sv_mutex); \
- if (sv_root) \
- uproot_SV(p); \
- else \
- (p) = more_sv(); \
- MUTEX_UNLOCK(&sv_mutex); \
+#define new_SV(p) do { \
+ LOCK_SV_MUTEX; \
+ if (sv_root) \
+ uproot_SV(p); \
+ else \
+ (p) = more_sv(); \
+ UNLOCK_SV_MUTEX; \
} while (0)
#ifdef DEBUGGING
-#define del_SV(p) do { \
- MUTEX_LOCK(&sv_mutex); \
- if (debug & 32768) \
- del_sv(p); \
- else \
- plant_SV(p); \
- MUTEX_UNLOCK(&sv_mutex); \
+#define del_SV(p) do { \
+ LOCK_SV_MUTEX; \
+ if (debug & 32768) \
+ del_sv(p); \
+ else \
+ plant_SV(p); \
+ UNLOCK_SV_MUTEX; \
} while (0)
static void