]> git.ipfire.org Git - thirdparty/gcc.git/commit
libatomic: Fix up libat_{,un}lock_n for mingw [PR119796]
authorJakub Jelinek <jakub@redhat.com>
Wed, 16 Apr 2025 15:22:49 +0000 (17:22 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 13 Jun 2025 11:10:09 +0000 (13:10 +0200)
commitb22c39bb9bd687fca05d590102b62e0acc88cacf
tree3a0e173069689bd8536f1012097c4b32d3d57bc7
parent5d0ce3a86fe32ded5ec52d849e7c2c1e31aabe39
libatomic: Fix up libat_{,un}lock_n for mingw [PR119796]

Here is just a port of the previously posted patch to mingw which
clearly has the same problems.

2025-04-16  Jakub Jelinek  <jakub@redhat.com>

PR libgcc/101075
PR libgcc/119796
* config/mingw/lock.c (libat_lock_n, libat_unlock_n): Start with
computing how many locks will be needed and take into account
((uintptr_t)ptr % WATCH_SIZE).  If some locks from the end of the
locks array and others from the start of it will be needed, first
lock the ones from the start followed by ones from the end.

(cherry picked from commit 34fe8e90007afbc87941df9b01ffcf8747c11497)
libatomic/config/mingw/lock.c