Re: PL_foo_mutex is global, _depth is per interpreter

[email protected] (Karl Williamson via perl5-porters) Fri, 22 May 2026 09:23:33 -0600
Newsgroups perl.perl5.porters
Message-ID <[email protected]>
On 5/22/26 06:28, Dave Mitchell wrote:
> There are a couple of variable pairs,
> 
>      PL_env_mutex    + PL_env_mutex_depth
>      PL_locale_mutex + PL_locale_mutex_depth
> 
> which are used as recursive locks: the depth variable holds the depth of
> recursion.
> 
> For both these pairs, the mutex var is global and is defined in
> perlvars.h, while the depth var is per-interpreter and is defined in
> intrpvar.h.
> 
> This sounds wrong to me. Is there anything here I'm not seeing, or should
> I move PL_*_mutex_depth to perlvars.h?

Examine 
https://github.com/Perl/perl5/pull/24098/changes/b84a36a829552194fc81634396757cdec0f5c4b9 
first to see if that explains it