}
-/* map magic types to the symbolic name
+/* map magic types to the symbolic names
* (with the PERL_MAGIC_ prefixed stripped)
*/
{ PERL_MAGIC_env, "env(E)" },
{ PERL_MAGIC_isa, "isa(I)" },
{ PERL_MAGIC_dbfile, "dbfile(L)" },
+ { PERL_MAGIC_shared, "shared(N)" },
{ PERL_MAGIC_tied, "tied(P)" },
{ PERL_MAGIC_sig, "sig(S)" },
{ PERL_MAGIC_uvar, "uvar(U)" },
{ PERL_MAGIC_nkeys, "nkeys(k)" },
{ PERL_MAGIC_dbline, "dbline(l)" },
{ PERL_MAGIC_mutex, "mutex(m)" },
+ { PERL_MAGIC_shared_scalar, "shared_scalar(n)" },
{ PERL_MAGIC_collxfrm, "collxfrm(o)" },
{ PERL_MAGIC_tiedelem, "tiedelem(p)" },
{ PERL_MAGIC_tiedscalar, "tiedscalar(q)" },
{ PERL_MAGIC_qr, "qr(r)" },
{ PERL_MAGIC_sigelem, "sigelem(s)" },
{ PERL_MAGIC_taint, "taint(t)" },
+ { PERL_MAGIC_uvar_elem, "uvar_elem(v)" },
{ PERL_MAGIC_vec, "vec(v)" },
{ PERL_MAGIC_substr, "substr(x)" },
{ PERL_MAGIC_defelem, "defelem(y)" },
-/* sharedsv.c
+/* shared.xs
*
- * Copyright (c) 2001, Larry Wall
+ * Copyright (c) 2001-2002, Larry Wall
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
recursive_lock_acquire(aTHX_ &ssv->lock, __FILE__, __LINE__);
}
+/* handles calls from lock() builtin via PL_lockhook */
+
void
Perl_sharedsv_locksv(pTHX_ SV *sv)
{
- Perl_sharedsv_lock(aTHX_ Perl_sharedsv_find(aTHX_ sv));
+ shared_sv* shared;
+
+ if(SvROK(sv))
+ sv = SvRV(sv);
+ shared = Perl_sharedsv_find(aTHX, sv);
+ if(!shared)
+ croak("lock can only be used on shared values");
+ Perl_sharedsv_lock(aTHX_ shared);
}
=head1 Shared SV Functions
PROTOTYPE: \[$@%]
CODE:
shared_sv *shared;
+ ref = SvRV(ref);
if(SvROK(ref))
ref = SvRV(ref);
if( (shared = Perl_sharedsv_find(aTHX_ ref)) ){
PROTOTYPE: \[$@%]
CODE:
shared_sv *shared;
+ ref = SvRV(ref);
if(SvROK(ref))
ref = SvRV(ref);
if( (shared = Perl_sharedsv_find(aTHX_ ref)) ){
share(SV *ref)
PROTOTYPE: \[$@%]
CODE:
+ ref = SvRV(ref);
if(SvROK(ref))
ref = SvRV(ref);
Perl_sharedsv_share(aTHX, ref);
PROTOTYPE: \[$@%]
CODE:
shared_sv* shared;
+ ref = SvRV(ref);
if(SvROK(ref))
ref = SvRV(ref);
shared = Perl_sharedsv_find(aTHX, ref);
CODE:
shared_sv* shared;
int locks;
+ ref = SvRV(ref);
if(SvROK(ref))
ref = SvRV(ref);
shared = Perl_sharedsv_find(aTHX_ ref);
PROTOTYPE: \[$@%]
CODE:
shared_sv* shared;
+ ref = SvRV(ref);
if(SvROK(ref))
ref = SvRV(ref);
shared = Perl_sharedsv_find(aTHX_ ref);
PROTOTYPE: \[$@%]
CODE:
shared_sv* shared;
+ ref = SvRV(ref);
if(SvROK(ref))
ref = SvRV(ref);
shared = Perl_sharedsv_find(aTHX_ ref);