summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/bits/libc-lock.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/bits/libc-lock.h')
-rw-r--r--sysdeps/mach/hurd/bits/libc-lock.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/sysdeps/mach/hurd/bits/libc-lock.h b/sysdeps/mach/hurd/bits/libc-lock.h
index 4ffb311036..c9872c661a 100644
--- a/sysdeps/mach/hurd/bits/libc-lock.h
+++ b/sysdeps/mach/hurd/bits/libc-lock.h
@@ -1,5 +1,5 @@
/* libc-internal interface for mutex locks. Hurd version using Mach cthreads.
- Copyright (C) 1996-2013 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 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
@@ -20,8 +20,10 @@
#define _BITS_LIBC_LOCK_H 1
#if (_LIBC - 0) || (_CTHREADS_ - 0)
+# if (_LIBC - 0)
+# include <tls.h>
+# endif
#include <cthreads.h>
-#include <hurd/threadvar.h>
typedef struct mutex __libc_lock_t;
typedef struct
@@ -32,7 +34,8 @@ typedef struct
} __libc_lock_recursive_t;
typedef __libc_lock_recursive_t __rtld_lock_recursive_t;
-#define __libc_lock_owner_self() ((void *) __hurd_threadvar_location (0))
+extern char __libc_lock_self0[0];
+#define __libc_lock_owner_self() (__LIBC_NO_TLS() ? &__libc_lock_self0 : THREAD_SELF)
#else
typedef struct __libc_lock_opaque__ __libc_lock_t;
@@ -203,4 +206,10 @@ void *__libc_getspecific (__libc_key_t key);
#endif /* _CTHREADS_ */
+/* Hide the definitions which are only supposed to be used inside libc in
+ a separate file. This file is not present in the installation! */
+#ifdef _LIBC
+# include <bits/libc-lockP.h>
+#endif
+
#endif /* bits/libc-lock.h */