]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Replace __lll_add calls with atomic_exchange_and_add calls respectively.
authorUlrich Drepper <drepper@redhat.com>
Thu, 20 Mar 2003 10:28:06 +0000 (10:28 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 20 Mar 2003 10:28:06 +0000 (10:28 +0000)
nptl/sysdeps/unix/sysv/linux/ia64/pthread_once.c
nptl/sysdeps/unix/sysv/linux/ia64/sem_post.c
nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c
nptl/sysdeps/unix/sysv/linux/sem_post.c
nptl/sysdeps/unix/sysv/linux/sem_timedwait.c
nptl/sysdeps/unix/sysv/linux/sem_trywait.c
nptl/sysdeps/unix/sysv/linux/sem_wait.c

index 2f671fac41be6479670a4ebdf2c2a40474daaf5c..c9e6be16b8a7ec8a26dc263394d494c6fe668f63 100644 (file)
@@ -80,7 +80,7 @@ __pthread_once (once_control, init_routine)
 
 
       /* Add one to *once_control.  */
-      __lll_add (once_control, 1);
+      atomic_exchange_and_add (once_control, 1);
 
       /* Wake up all other threads.  */
       lll_futex_wake (once_control, INT_MAX);
index 9b5049e7aef83a7b0f0e35a785b0520eee187356..0527abeba6c25331e4e5a80963b2c075f37b8350 100644 (file)
@@ -32,7 +32,7 @@ __new_sem_post (sem_t *sem)
   int *futex = (int *) sem;
   int err, nr;
 
-  nr = __lll_add (futex, 1);
+  nr = atomic_exchange_and_add (futex, 1);
   err = lll_futex_wake (futex, nr + 1);
   if (__builtin_expect (err, 0) < 0)
     {
index 18029e979d779203d74af7046b64f25d2a685a3c..88acb26e03330e01fa74bdd67df1b9d589fd9e35 100644 (file)
@@ -88,7 +88,7 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
 
 
   /* Add one to *once_control to take the bottom 2 bits from 01 to 10.  */
-  __lll_add (once_control, 1);
+  atomic_exchange_and_add (once_control, 1);
 
   /* Wake up all other threads.  */
   lll_futex_wake (once_control, INT_MAX);
index 77defc84f99fd85cad30c7199cdcda388c470ab9..2da6ecd696c0ff2b8f23cf853a2fdb35c3883cbf 100644 (file)
@@ -33,7 +33,7 @@ __new_sem_post (sem_t *sem)
   int err, nr;
 
   __asm __volatile (__lll_rel_instr ::: "memory");
-  nr = __lll_add (futex, 1);
+  nr = atomic_exchange_and_add (futex, 1);
   err = lll_futex_wake (futex, nr);
   if (err == 0)
     return 0;
index e1b32f4e782c3053e19beda06ecf4e8357f13f87..632cce43918e753a3004197b561aba256ceae7a5 100644 (file)
@@ -36,7 +36,7 @@ sem_timedwait (sem_t *sem, const struct timespec *abstime)
 
   if (*futex > 0)
     {
-      val = __lll_dec_if_positive (futex);
+      val = atomic_decrement_if_positive (futex);
       if (val > 0)
        return 0;
     }
@@ -75,7 +75,7 @@ sem_timedwait (sem_t *sem, const struct timespec *abstime)
       if (err != 0 && err != -EWOULDBLOCK)
        goto error_return;
 
-      val = __lll_dec_if_positive (futex);
+      val = atomic_decrement_if_positive (futex);
     }
   while (val <= 0);
 
index a7b60a10237a5ac7a3a7ba8efe2f6db8c5c8b0c9..f500361143828dcee1fcf917becf4fc33f994430 100644 (file)
@@ -35,7 +35,7 @@ __new_sem_trywait (sem_t *sem)
 
   if (*futex > 0)
     {
-      val = __lll_dec_if_positive (futex);
+      val = atomic_decrement_if_positive (futex);
       if (val > 0)
        return 0;
     }
index 0e50067cf6a480a08516d6a69b25375988f36eb0..1d39b7c4089f14f74d5a1e455c733870a780b55b 100644 (file)
@@ -38,7 +38,7 @@ __new_sem_wait (sem_t *sem)
     {
       if (*futex > 0)
        {
-         val = __lll_dec_if_positive (futex);
+         val = atomic_decrement_if_positive (futex);
          if (val > 0)
            return 0;
        }