This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libstdc++: Fix conformance issues in <stop_token> (PR92895)


Looks good to me, ok for trunk.

Thanks.

Jonathan Wakely writes:

> Fix synchronization issues in <stop_token>. Replace shared_ptr with
> _Stop_state_ref and a reference count embedded in the shared state.
> Replace std::mutex with spinlock using one bit of a std::atomic<> that
> also tracks whether a stop request has been made and how many
> stop_source objects share ownership of the state.
>
> The synchronization with callbacks being destroyed is based on the
> implementation by Lewis Baker and Nico Josuttis. It allows the
> callback being destroyed to detect whether it's currently running, and
> if so whether on the current thread or a different one.
>
> Tom, please take a look and give a review. As discussed, the
> binary_semaphore is temporary, until we have the real thing.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]