develooper Front page | perl.perl5.changes | Postings from January 2022

[Perl/perl5] ec238e: For C++ extensions, use the pthreads definitionof...

From:
Nicholas Clark via perl5-changes
Date:
January 4, 2022 18:48
Subject:
[Perl/perl5] ec238e: For C++ extensions, use the pthreads definitionof...
Message ID:
Perl/perl5/push/refs/heads/smoke-me/nicholas/pthreads-not-_Thread_local-for-C++/000000-ec238e@github.com
  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 <nick@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().





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About