From: Gurusamy Sarathy Date: Tue, 11 Nov 1997 00:26:09 +0000 (+0000) Subject: "weak" lock keyword (hardcoded initial implementation) now works. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e7b23362bbae8d13123bf406d494975427fd06f;p=p5sagit%2Fp5-mst-13.2.git "weak" lock keyword (hardcoded initial implementation) now works. if not defined(&Thread::join) and defined(&__PACKAGE__::lock), 'lock' is recognized as a sub, a regular keyword otherwise. Could be generalized by storing a flag for every op in OP struct, and turning the flag off when Thread.xs loads. p4raw-id: //depot/win32/perl@225 --- diff --git a/toke.c b/toke.c index df5e0eb..07a1656 100644 --- a/toke.c +++ b/toke.c @@ -2603,7 +2603,13 @@ yylex() (gv = *gvp) != (GV*)&sv_undef && GvCVu(gv) && GvIMPORTED_CV(gv)))) { - tmp = 0; + tmp = 0; /* overridden by importation */ + } + else if (gv && !gvp + && -tmp==KEY_lock /* XXX generalizable kludge */ + && !gv_fetchpv("Thread::join",FALSE,SVt_PVCV)) + { + tmp = 0; /* any sub overrides "weak" keyword */ } else { tmp = -tmp; gv = Nullgv; gvp = 0;