The function you need to call is Perl_sharedsv_locksv(pTHX_ SV *sv) found in threads::shared.xs.
But good luck in working out how to link to it.
Another mystery that has long defeated me is quite where the perl-level lock() function (keyword or operator) lives and how it gets translated into a call to the above.
In reply to Re: threads::shared locking via C API
by BrowserUk
in thread threads::shared locking via C API
by halfcountplus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |