Date: Mon, 25 Aug 2025 17:40:47 +0200
Den 2025-08-25 kl. 07:47, skrev Thiago Macieira via Std-Proposals:
> 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.
I'm guessing that a freestanding implementation which can't tell what
time it is doesn't even have a _TimedMutex_ - or any of the other types
for which you can wait_for/wait_until - or
this_thread::sleep_for/sleep_until. Those would have the same problems
unless I'm mistaken.
Best regards,
Ted Lyngmo
> 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.
I'm guessing that a freestanding implementation which can't tell what
time it is doesn't even have a _TimedMutex_ - or any of the other types
for which you can wait_for/wait_until - or
this_thread::sleep_for/sleep_until. Those would have the same problems
unless I'm mistaken.
Best regards,
Ted Lyngmo
Received on 2025-08-25 15:40:51