summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-10-09 20:01:19 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-10-09 20:01:19 +0200
commit3896c5809b49e72fbadc57da2189ff42aa2a5d02 (patch)
tree976132226affe5ff11686d86d01d059aa5eabc6c /sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
parent52c6cb0bba348bf5f25ff2a213e04c0f3fc378aa (diff)
parent4dc1e6e42f1f602e1d2227e112f2db8dce9da763 (diff)
Merge commit 'refs/top-bases/t/hurdsig-boot-fix' into t/hurdsig-boot-fix
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/elision-trylock.c')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/elision-trylock.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c b/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
index 7b6d1b9b98..0807a6a432 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
@@ -1,5 +1,5 @@
/* elision-trylock.c: Lock eliding trylock for pthreads.
- Copyright (C) 2015 Free Software Foundation, Inc.
+ Copyright (C) 2015-2016 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
@@ -31,22 +31,25 @@ int
__lll_trylock_elision (int *futex, short *adapt_count)
{
/* Implement POSIX semantics by forbiding nesting elided trylocks. */
- __builtin_tabort (_ABORT_NESTED_TRYLOCK);
+ __libc_tabort (_ABORT_NESTED_TRYLOCK);
/* Only try a transaction if it's worth it. */
if (*adapt_count > 0)
{
- (*adapt_count)--;
goto use_lock;
}
- if (__builtin_tbegin (0))
+ if (__libc_tbegin (0))
{
if (*futex == 0)
return 0;
- /* Lock was busy. Fall back to normal locking. */
- __builtin_tabort (_ABORT_LOCK_BUSY);
+ /* Lock was busy. This is never a nested transaction.
+ End it, and set the adapt count. */
+ __libc_tend (0);
+
+ if (aconf.skip_lock_busy > 0)
+ *adapt_count = aconf.skip_lock_busy;
}
else
{
@@ -58,9 +61,6 @@ __lll_trylock_elision (int *futex, short *adapt_count)
if (aconf.skip_trylock_internal_abort > 0)
*adapt_count = aconf.skip_trylock_internal_abort;
}
-
- if (aconf.skip_lock_busy > 0)
- *adapt_count = aconf.skip_lock_busy;
}
use_lock: