C++ Logo

std-proposals

Advanced search

Re: [std-proposals] int Func(void) noreentry(-1)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 15 Feb 2023 07:45:34 -0800
On Wednesday, 15 February 2023 02:37:18 PST Frederick Virchanza Gotham via
Std-Proposals wrote:
> > atomic_flag is unlikely to be the correct solution. A mutex would is more
> > likely.
> The two standard library types, mutex and recursive_mutex, can prevent
> re-entry by a different thread. They cannot prevent re-entry by the
> same thread.

The two statements aren't incompatible.

I stand by what I said: mutexes will be more commonly used, because I don't
think prevent-reentry-by-returning is a commonplace need.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-02-15 15:45:36