]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / powerpc / elision-unlock.c
index 759c1464a79859e71358825062bc1c43232d2544..18ec23fa64e6dd7337739417fb42240d1f12a0c3 100644 (file)
@@ -1,5 +1,5 @@
 /* elision-unlock.c: Commit an elided pthread lock.
-   Copyright (C) 2015-2017 Free Software Foundation, Inc.
+   Copyright (C) 2015-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -23,6 +23,7 @@
 int
 __lll_unlock_elision (int *lock, short *adapt_count, int pshared)
 {
+#ifndef __SPE__
   /* When the lock was free we're in a transaction.  */
   if (*lock == 0)
     __libc_tend (0);
@@ -35,9 +36,12 @@ __lll_unlock_elision (int *lock, short *adapt_count, int pshared)
         the mutex destruction requirements.  */
       short __tmp = atomic_load_relaxed (adapt_count);
       if (__tmp > 0)
-       atomic_store_relaxed (adapt_count, __tmp--);
+       atomic_store_relaxed (adapt_count, __tmp - 1);
 
       lll_unlock ((*lock), pshared);
     }
+#else
+  lll_unlock ((*lock), pshared);
+#endif
   return 0;
 }