about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv/linux/sem_post.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-08-31 19:49:31 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-08-31 19:49:31 +0000
commit033d54a2d43a92cdb1794a4dfece4d465cf36f6b (patch)
tree398c6f127057702fb0f9254ee1c76e2cb224fdcf /nptl/sysdeps/unix/sysv/linux/sem_post.c
parentd22e28b070d3d1572d39a463d711c6f223078552 (diff)
downloadglibc-033d54a2d43a92cdb1794a4dfece4d465cf36f6b.tar.gz
glibc-033d54a2d43a92cdb1794a4dfece4d465cf36f6b.tar.xz
glibc-033d54a2d43a92cdb1794a4dfece4d465cf36f6b.zip
Fix sem_post race (bug 14532).
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/sem_post.c')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sem_post.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/sem_post.c b/nptl/sysdeps/unix/sysv/linux/sem_post.c
index 56f27e977e..67e8cc5429 100644
--- a/nptl/sysdeps/unix/sysv/linux/sem_post.c
+++ b/nptl/sysdeps/unix/sysv/linux/sem_post.c
@@ -1,5 +1,5 @@
 /* sem_post -- post to a POSIX semaphore.  Generic futex-using version.
-   Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2003-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
@@ -40,7 +40,7 @@ __new_sem_post (sem_t *sem)
 	  return -1;
 	}
     }
-  while (atomic_compare_and_exchange_bool_acq (&isem->value, cur + 1, cur));
+  while (atomic_compare_and_exchange_bool_rel (&isem->value, cur + 1, cur));
 
   atomic_full_barrier ();
   if (isem->nwaiters > 0)