diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-09-24 03:36:30 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-09-24 03:36:30 +0000 |
commit | 5f08fbcd6341ee0f8f3c7dfe721098c3bfae1c67 (patch) | |
tree | a70127e53b67320af4d734e666f8494d502244f6 /hv.c | |
parent | 34b5802582e6ac0ab95ef6940fa408896842b141 (diff) | |
download | perl-5f08fbcd6341ee0f8f3c7dfe721098c3bfae1c67.tar.gz |
provide locked access to string table for USE_THREADS
p4raw-id: //depot/perl@1863
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1149,6 +1149,7 @@ unsharepvn(char *str, I32 len, U32 hash) } */ xhv = (XPVHV*)SvANY(PL_strtab); /* assert(xhv_array != 0) */ + LOCK_STRTAB_MUTEX; oentry = &((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max]; for (entry = *oentry; entry; i=0, oentry = &HeNEXT(entry), entry = *oentry) { if (HeHASH(entry) != hash) /* strings can't be equal */ @@ -1166,6 +1167,7 @@ unsharepvn(char *str, I32 len, U32 hash) del_he(entry); --xhv->xhv_keys; } + UNLOCK_STRTAB_MUTEX; break; } @@ -1193,6 +1195,7 @@ share_hek(char *str, I32 len, register U32 hash) */ xhv = (XPVHV*)SvANY(PL_strtab); /* assert(xhv_array != 0) */ + LOCK_STRTAB_MUTEX; oentry = &((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max]; for (entry = *oentry; entry; i=0, entry = HeNEXT(entry)) { if (HeHASH(entry) != hash) /* strings can't be equal */ @@ -1219,6 +1222,7 @@ share_hek(char *str, I32 len, register U32 hash) } ++HeVAL(entry); /* use value slot as REFCNT */ + UNLOCK_STRTAB_MUTEX; return HeKEY_hek(entry); } |