Branch: refs/heads/smoke-me/nicholas/pthreads-not-_Thread_local-for-C++
  Home:   https://github.com/Perl/perl5
  Commit: ec238e5dff1c782cf69f109443a52540711b08d9
      
https://github.com/Perl/perl5/commit/ec238e5dff1c782cf69f109443a52540711b08d9
  Author: Nicholas Clark <n...@ccl4.org>
  Date:   2022-01-04 (Tue, 04 Jan 2022)

  Changed paths:
    M thread.h

  Log Message:
  -----------
  For C++ extensions, use the pthreads definition of PERL_GET_CONTEXT

Configure probes the C compiler to find out whether it supports C11 thread
local storage, and if found uses this for PERL_SET_CONTEXT/PERL_GET_CONTEXT,
in preference to the pthread_setspecific()/pthread_getspecific() approach.

However, we can come unstuck with XS extensions written in C++, as on some
platforms the C++ compiler can use different syntax for thread local storage.
As Configure doesn't have a way to probe for C++ dialects, we just take the
safe option and do the same as 5.34.0 and earlier - use pthreads on C++.

This commit is minimal because the implementation of PERL_SET_CONTEXT for
C11 thread local storage was already defensively written to *also* call
pthread_setspecific().


Reply via email to