#include <stddef.h>
+#if defined _LIBC && !defined NOT_IN_libc
/* Nonzero if locking is needed. */
extern int __libc_locking_needed attribute_hidden;
+#endif
/* Fortunately Linux now has a mean to do locking which is realtime
/* Initialize the named lock variable, leaving it in a consistent, unlocked
state. */
#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
-# define __libc_lock_init(NAME) (NAME) = LLL_LOCK_INITIALIZER;
+# define __libc_lock_init(NAME) ((NAME) = LLL_LOCK_INITIALIZER, 0)
#else
# define __libc_lock_init(NAME) \
__libc_maybe_call (__pthread_mutex_init, (&(NAME), NULL), 0)
/* Same as last but this time we initialize a recursive mutex. */
#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
# define __libc_lock_init_recursive(NAME) \
- (NAME) = (__libc_lock_recursive_t) _LIBC_LOCK_RECURSIVE_INITIALIZER
+ ((NAME) = (__libc_lock_recursive_t) _LIBC_LOCK_RECURSIVE_INITIALIZER, 0)
#else
# define __libc_lock_init_recursive(NAME) \
do { \
/* Lock the named lock variable. */
#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
# define __libc_lock_lock(NAME) \
- lll_lock (NAME);
+ ({ lll_lock (NAME); 0; })
#else
# define __libc_lock_lock(NAME) \
__libc_maybe_call (__pthread_mutex_lock, (&(NAME)), 0)
/* Unlock the named lock variable. */
#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
# define __libc_lock_unlock(NAME) \
- lll_unlock (NAME);
+ lll_unlock (NAME)
#else
# define __libc_lock_unlock(NAME) \
__libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0)