C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Freestanding try_lock_for and try_lock_until

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 24 Aug 2025 22:47:24 -0700
On Sunday, 24 August 2025 21:54:05 Pacific Daylight Time Jan Schultke via Std-
Proposals wrote:
> > I wonder, are there any inherent reasons why we shouldn't have such
> > function templates in the standard library? If so, I won't pursure
> > writing a proposal. If it's just a case of "noone wanted them bad enough
> > to write a proposal", I may go ahead.
>
> I don't know the history, but how would those even be implemented? The
> obvious issue is that if you try_lock_for one second

How do you even get the time in a freestanding implementation?

I could see a spinlock-based, untimed API in a freestanding library, but no
more.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering

Received on 2025-08-25 05:47:26