From 042e1521c794a945edc43b5bfa7e69ad70420524 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Wed, 21 Jan 2015 00:46:16 -0500 Subject: Fix semaphore destruction (bug 12674). This commit fixes semaphore destruction by either using 64b atomic operations (where available), or by using two separate fields when only 32b atomic operations are available. In the latter case, we keep a conservative estimate of whether there are any waiting threads in one bit of the field that counts the number of available tokens, thus allowing sem_post to atomically both add a token and determine whether it needs to call futex_wake. See: https://sourceware.org/ml/libc-alpha/2014-12/msg00155.html --- sysdeps/unix/sysv/linux/i386/i686/sem_post.S | 19 ------------------- sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S | 19 ------------------- sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S | 19 ------------------- sysdeps/unix/sysv/linux/i386/i686/sem_wait.S | 19 ------------------- 4 files changed, 76 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/i386/i686/sem_post.S delete mode 100644 sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S delete mode 100644 sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S delete mode 100644 sysdeps/unix/sysv/linux/i386/i686/sem_wait.S (limited to 'sysdeps/unix/sysv/linux/i386/i686') diff --git a/sysdeps/unix/sysv/linux/i386/i686/sem_post.S b/sysdeps/unix/sysv/linux/i386/i686/sem_post.S deleted file mode 100644 index 4534d567d8..0000000000 --- a/sysdeps/unix/sysv/linux/i386/i686/sem_post.S +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2003. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include "../i486/sem_post.S" diff --git a/sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S b/sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S deleted file mode 100644 index fa4ad496e5..0000000000 --- a/sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2003. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include "../i486/sem_timedwait.S" diff --git a/sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S b/sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S deleted file mode 100644 index 6f3a690d77..0000000000 --- a/sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2003. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include "../i486/sem_trywait.S" diff --git a/sysdeps/unix/sysv/linux/i386/i686/sem_wait.S b/sysdeps/unix/sysv/linux/i386/i686/sem_wait.S deleted file mode 100644 index 718d50d680..0000000000 --- a/sysdeps/unix/sysv/linux/i386/i686/sem_wait.S +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2003. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include "../i486/sem_wait.S" -- cgit 1.4.1