diff options
author | Nicholas Clark <nick@ccl4.org> | 2022-01-08 21:08:19 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2022-01-12 20:12:50 +0000 |
commit | 34e35871651eac526a753c06710cac081848d75f (patch) | |
tree | 6d6ab63ad7ee87fda4369738f539f887b14e899a /README.win32 | |
parent | c4b6855dd57cd9a2ac4647c33c5636ed7d15d64a (diff) | |
download | perl-34e35871651eac526a753c06710cac081848d75f.tar.gz |
PERL_SET_CONTEXT(t) needs to set PL_current_context from C++ too
We want to use C11 thread local storage where possible, as its read overhead
is lower. However C++ uses incompatible syntax for TLS, so we have to hide
the variable from C++ extensions, and have the read code "fall back" to the
pthread_getspecific() approach.
However, C++ extensions also need to be able to call PERL_SET_CONTEXT(t) and
have everything still work the same as C extensions. Hence they *also* need
to set PL_current_context - a variable that has to be hidden from them.
Hence change the version of the PERL_SET_CONTEXT macro used by C++
extensions from inline code to a call to Perl_set_context(), and have that
set PL_current_context (when used).
Technically this commit also fixes a bug in that Perl_set_context() is API
and should have been setting PL_current_context since that variable was
first introduced. In practice, likely nothing uses this API, as there is no
code on CPAN that calls it, and the macro PERL_SET_CONTEXT() is much more
prominent.
Diffstat (limited to 'README.win32')
0 files changed, 0 insertions, 0 deletions