in reply to Re: threads::shared locking via C API
in thread threads::shared locking via C API

The way I understand, you use threads::shared; and then SvLOCK and SvUNLOCK will call threads::shared::lock, but if threads::shared isn't loaded, it falls back to sv_nolocking and sv_nounlocking

Replies are listed 'Best First'.
Re^3: threads::shared locking via C API
by BrowserUk (Patriarch) on Aug 26, 2011 at 10:38 UTC

    Yes, thanks. But that doesn't get you very far.

    c:\test\perl-5.14.0-RC1>findstr SvLOCK *.? pp.c: SvLOCK(sv); sv.h:=for apidoc Am|void|SvLOCK|SV* sv sv.h:#define SvLOCK(sv) PL_lockhook(aTHX_ sv) c:\test\perl-5.14.0-RC1>findstr PL_lockhook *.? embedvar.h:#define PL_lockhook (vTHX->Ilockhook) embedvar.h:#define PL_Ilockhook PL_lockhook sv.c: PL_lockhook = proto_perl->Ilockhook; sv.h:#define SvLOCK(sv) PL_lockhook(aTHX_ sv) c:\test\perl-5.14.0-RC1>findstr Ilockhook *.? embedvar.h:#define PL_lockhook (vTHX->Ilockhook) embedvar.h:#define PL_Ilockhook PL_lockhook intrpvar.h:PERLVARI(Ilockhook, share_proc_t, Perl_sv_nosharing) sv.c: PL_lockhook = proto_perl->Ilockhook;

    The whole 'lock locks the variable if threading is enable but is a silent noop otherwise', is the single most pointless piece of logic ever. (After the over-elaborate feature mechanism that is.)


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.