From 6e7b23362bbae8d13123bf406d494975427fd06f Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Tue, 11 Nov 1997 00:26:09 +0000 Subject: [PATCH] "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 --- toke.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.7.4