diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-03-24 06:34:59 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-03-24 06:34:59 +0000 |
commit | ce3f7d21bd70fc5475a6c2bfcb85b253e588309b (patch) | |
tree | 54f2e81f5a4eef53ceaa78b9dc0fda28bc2b7e18 /sysdeps | |
parent | 04520d8eebe787181b5d74e5f5ddb0c068ee4117 (diff) | |
download | glibc-ce3f7d21bd70fc5475a6c2bfcb85b253e588309b.tar glibc-ce3f7d21bd70fc5475a6c2bfcb85b253e588309b.tar.gz glibc-ce3f7d21bd70fc5475a6c2bfcb85b253e588309b.tar.bz2 glibc-ce3f7d21bd70fc5475a6c2bfcb85b253e588309b.zip |
Define lll_mutex_cond_trylock.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h index 9d125e0d6d..a7079a8490 100644 --- a/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004 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 @@ -80,6 +80,14 @@ __lll_mutex_trylock(int *futex) #define lll_mutex_trylock(lock) __lll_mutex_trylock (&(lock)) +static inline int __attribute__((always_inline)) +__lll_mutex_cond_trylock(int *futex) +{ + return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0; +} +#define lll_mutex_cond_trylock(lock) __lll_mutex_cond_trylock (&(lock)) + + extern void __lll_lock_wait (int *futex) attribute_hidden; static inline void __attribute__((always_inline)) |