[PATCH] Add c++2a binary_semaphore

Jonathan Wakely jwakely@redhat.com
Tue Feb 25 12:39:00 GMT 2020


On 25/02/20 12:33 +0000, Jonathan Wakely wrote:
>On 25/02/20 09:52 +0100, Sebastian Huber wrote:
>>Hello Thomas,
>>
>>some operating systems provide already an implementation of binary 
>>semaphores with a compatible API, e.g. RTEMS. It would be nice if I 
>>could use it in libstdc++. I guess you don't want to have #ifdef 
>>__rtems__ stuff in this code. What about defining a binary semaphore 
>>API for gthr.h and then implement the optional futex support in 
>>libgcc/gthr-posix.h?
>
>gthr.h is supposed to be an abstraction of pthreads, not futexes. I
>also don't see why more libstdc++ code should live in libgcc than
>necessary.
>
>It would be OK to add semaphore support to gthr-*.h and then have
>libstdc++ either use futexes (where available) or the gthr code.

Note however, that any additions to gthr.h are out of scope for GCC
10, as we're already in stage 4.

Local additions to libstdc++ for experimental C++20 features are still
OK now.



More information about the Libstdc++ mailing list