https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119796
--- Comment #8 from AlphaOmegaProgrammer ---
> So what about this untested patch?
I've spent about an hour trying to find flaws in the idea, and I can't think of
any. I applied the patch and it fixed the deadlock for me in my test code.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119796
--- Comment #7 from Jakub Jelinek ---
Created attachment 61110
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61110&action=edit
gcc15-pr119796.patch
So what about this untested patch?
Leaving aside whether we really need to lock more than
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119796
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #6
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119796
--- Comment #5 from AlphaOmegaProgrammer ---
> Please see https://gcc.gnu.org/contribute.html for how to contribute, which
> includes sending a real patch
My apologies, this is my first time trying to contribute. I'll do this.
> This can only
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119796
Richard Biener changed:
What|Removed |Added
Ever confirmed|0 |1
Status|UNCONFIRMED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119796
--- Comment #4 from Jonathan Wakely ---
(In reply to AlphaOmegaProgrammer from comment #0)
> The problem with the current implementation is that it relies on a hash of
> the lower 12 bits of the pointer address to index an array of mutexes, and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119796
--- Comment #3 from Jonathan Wakely ---
(In reply to AlphaOmegaProgrammer from comment #1)
> Created attachment 61108 [details]
> Current implementation of locking algorithm
>
> This file can be found at /libatomic/config/posix/lock.c
You don'
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119796
--- Comment #2 from AlphaOmegaProgrammer ---
Created attachment 61109
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61109&action=edit
Proposed Patch
This is my proposed patch. I've tested it and my test case no longer deadlocks,
and none
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119796
--- Comment #1 from AlphaOmegaProgrammer ---
Created attachment 61108
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61108&action=edit
Current implementation of locking algorithm
This file can be found at /libatomic/config/posix/lock.c