Message-Id: <
19980924220109J.drago@otsd.ts.fujitsu.co.jp>
Subject: [PATCH 5.005_51] Re: Perl 5.005_51 not yet multi Thread safe
p4raw-id: //depot/perl@1880
#ifndef PERL_OBJECT
static void hsplit _((HV *hv));
static void hfreeentries _((HV *hv));
-static HE* more_he _((void));
+static void more_he _((void));
#endif
#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
new_he(void)
{
HE* he;
- if (PL_he_root) {
- he = PL_he_root;
- PL_he_root = HeNEXT(he);
- return he;
- }
- return more_he();
+ LOCK_SV_MUTEX;
+ if (!PL_he_root)
+ more_he();
+ he = PL_he_root;
+ PL_he_root = HeNEXT(he);
+ UNLOCK_SV_MUTEX;
+ return he;
}
STATIC void
del_he(HE *p)
{
+ LOCK_SV_MUTEX;
HeNEXT(p) = (HE*)PL_he_root;
PL_he_root = p;
+ UNLOCK_SV_MUTEX;
}
-STATIC HE*
+STATIC void
more_he(void)
{
register HE* he;
he++;
}
HeNEXT(he) = 0;
- return new_he();
}
STATIC HEK *
del_he(entry);
--xhv->xhv_keys;
}
- UNLOCK_STRTAB_MUTEX;
break;
}
+ UNLOCK_STRTAB_MUTEX;
if (!found)
warn("Attempt to free non-existent shared string");
protected:
void hsplit _((HV *hv));
void hfreeentries _((HV *hv));
-HE* more_he _((void));
+void more_he _((void));
HE* new_he _((void));
void del_he _((HE *p));
HEK *save_hek _((char *str, I32 len, U32 hash));