PP(pp_enter)
{
djSP;
- register CONTEXT *cx;
+ register PERL_CONTEXT *cx;
I32 gimme = OP_GIMME(op, -1);
if (gimme == -1) {
PP(pp_leave)
{
djSP;
- register CONTEXT *cx;
+ register PERL_CONTEXT *cx;
register SV **mark;
SV **newsp;
PMOP *newpm;
PP(pp_iter)
{
djSP;
- register CONTEXT *cx;
+ register PERL_CONTEXT *cx;
SV* sv;
AV* av;
sv_setpvn(dstr, m, s-m);
curpm = pm;
if (!c) {
- register CONTEXT *cx;
+ register PERL_CONTEXT *cx;
PUSHSUBST(cx);
RETURNOP(cPMOP->op_pmreplroot);
}
SV **newsp;
PMOP *newpm;
I32 gimme;
- register CONTEXT *cx;
+ register PERL_CONTEXT *cx;
struct block_sub cxsub;
POPBLOCK(cx,newpm);
GV *gv;
HV *stash;
register CV *cv;
- register CONTEXT *cx;
+ register PERL_CONTEXT *cx;
I32 gimme;
bool hasargs = (op->op_flags & OPf_STACKED) != 0;
#ifdef USE_THREADS
/*
* First we need to check if the sub or method requires locking.
- * If so, we gain a lock on the CV or the first argument, as
- * appropriate. This has to be inline because for FAKE_THREADS,
- * COND_WAIT inlines code to reschedule by returning a new op.
+ * If so, we gain a lock on the CV, the first argument or the
+ * stash (for static methods), as appropriate. This has to be
+ * inline because for FAKE_THREADS, COND_WAIT inlines code to
+ * reschedule by returning a new op.
*/
MUTEX_LOCK(CvMUTEXP(cv));
if (CvFLAGS(cv) & CVf_LOCKED) {
}
if (SvROK(sv))
sv = SvRV(sv);
+ else {
+ STRLEN len;
+ char *stashname = SvPV(sv, len);
+ sv = (SV*)gv_stashpvn(stashname, len, TRUE);
+ }
}
else {
sv = (SV*)cv;
* (3) instead of (2) so we'd have to clone. Would the fact
* that we released the mutex more quickly make up for this?
*/
- svp = hv_fetch(cvcache, (char *)cv, sizeof(cv), FALSE);
+ svp = hv_fetch(thr->cvcache, (char *)cv, sizeof(cv), FALSE);
if (svp) {
/* We already have a clone to use */
MUTEX_UNLOCK(CvMUTEXP(cv));
*/
clonecv = cv_clone(cv);
SvREFCNT_dec(cv); /* finished with this */
- hv_store(cvcache, (char*)cv, sizeof(cv), (SV*)clonecv,0);
+ hv_store(thr->cvcache, (char*)cv, sizeof(cv), (SV*)clonecv,0);
CvOWNER(clonecv) = thr;
cv = clonecv;
SvREFCNT_inc(cv);