C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Exceptions : lost all hope -- do not resuscitate

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sat, 06 Jun 2026 13:56:26 -0700
On Saturday, 6 June 2026 11:03:15 Pacific Daylight Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> The pull request went through code review, and a colleague of mine
> responded to say:
>
> "You've marked that function 'noexcept' but 'mutex::lock' might throw"
>
> My response to him was:
>
> "If a mutex fails to lock, the entire process is fried"

The other reason is that you've made a mistake in your code and this is a bug.
A checking mutex can fail if a deadlock would occur (already locked by this
thread).

But either way, the process can't continue.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center - Platform & Sys. Eng.

Received on 2026-06-06 20:56:33