C++ Logo

std-proposals

Advanced search

Re: [std-proposals] atomic_compare_exchange_and_notify

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Thu, 15 Jan 2026 23:13:55 +0000
On Thu, 15 Jan 2026 at 22:30, Andrey Semashev via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On 15 Jan 2026 23:11, Ryan P. Nicholl wrote:
> >> If you're having in mind a specific usage scenario involving std::latch,
> > where one of the waiters destroys the latch as soon as it wakes up, then
> > that would be an error of the user of std::latch.
> >
> > The standard explicitly says this is allowed and well defined behavior.
>
> Could you point to the specific standard wording that says this?
>

For std::mutex it's here:
https://eel.is/c++draft/thread#mutex.class-note-1

I don't know that std::latch says it.

std::condition_variable has a special rule too, inherited from POSIX:
https://eel.is/c++draft/thread#condition.condvar-note-1

See the informatie EXAMPLES section at
https://pubs.opengroup.org/onlinepubs/9799919799/functions/pthread_cond_destroy.html



>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2026-01-15 23:14:12