Dan Sugalski <dan@sidhe.org> writes: >The following patch provides a new macro, SvLOCK, which lets XS code snag a >perl-level lock on an arbitrary SV *. Thanks for this - it will be vital to thread-safing Tk and other heavy XS extensions. >+=item SvLOCK >+ >+Take out a perl lock on the SV. (Note that this is B<not> the same as >+aquiring a mutex on the SV *) Equivalent to doing a C<lock $foo;> >+from perl. >+ >+ void SvLOCK(SV* sv) >+ I assume that normal use is something like: ENTER; SvLOCK(sv) ... LEAVE; i.e. that it unlocks on scope exit like C<local $foo>. If so suggest you document it that way. -- Nick Ing-Simmons <nik@tiuk.ti.com> Via, but not speaking for: Texas Instruments Ltd.