public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/112089] New: std::shared_lock::unlock should throw operation_not_permitted instead resource_deadlock_would_occur
@ 2023-10-25 21:16 d at ilvokhin dot com
  2023-10-25 21:32 ` [Bug libstdc++/112089] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: d at ilvokhin dot com @ 2023-10-25 21:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112089

            Bug ID: 112089
           Summary: std::shared_lock::unlock should throw
                    operation_not_permitted instead
                    resource_deadlock_would_occur
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: d at ilvokhin dot com
  Target Milestone: ---

Based on C++ standard wording, when we call unlock and don't own anything we
should throw operation_not_permitted. Sec 33.6.5.5.3 from here
(https://eel.is/c++draft/thread.lock.shared.locking#25.1):
> void unlock();
> <...>
> Error conditions:
> operation_not_permitted — if on entry owns is false.

But current implementation throws resource_deadlock_would_occur instead:
https://github.com/gcc-mirror/gcc/blob/458db9b6149b2e9bef94ab76909eb914ed9f675a/libstdc%2B%2B-v3/include/std/shared_mutex#L823

It doesn't change much, just a little inconsistency.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-18 14:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-25 21:16 [Bug libstdc++/112089] New: std::shared_lock::unlock should throw operation_not_permitted instead resource_deadlock_would_occur d at ilvokhin dot com
2023-10-25 21:32 ` [Bug libstdc++/112089] " redi at gcc dot gnu.org
2023-10-26 20:11 ` cvs-commit at gcc dot gnu.org
2023-10-26 20:36 ` redi at gcc dot gnu.org
2023-11-08 13:18 ` cvs-commit at gcc dot gnu.org
2024-03-18 14:06 ` cvs-commit at gcc dot gnu.org
2024-03-18 14:14 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).