summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Janda <felix.janda@posteo.de>2015-02-02 20:04:16 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2015-03-25 21:33:26 +0000
commit29810e43dad8573b5986c58bcd208463ddf18957 (patch)
tree5c8e33850121a17a9d33ca56ef9c704446dcddc2
parent2e0f2ad59c8d98ebe545d911747079a1a7958acf (diff)
c11/threads: Use PTHREAD_MUTEX_RECURSIVE by default
Previously PTHREAD_MUTEX_RECURSIVE_NP had been used on linux for compatibility with old glibc. Since mesa defines __GNU_SOURCE__ on linux PTHREAD_MUTEX_RECURSIVE is also available since at least 1998. So we can unconditionally use the portable version PTHREAD_MUTEX_RECURSIVE. Cc: "10.5" <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88534 Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (cherry picked from commit aead7fe2e2b6c89258f80a25299f4ec0fece2d95)
-rw-r--r--include/c11/threads_posix.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h
index f9c165df4e0..2182c2835aa 100644
--- a/include/c11/threads_posix.h
+++ b/include/c11/threads_posix.h
@@ -177,13 +177,8 @@ mtx_init(mtx_t *mtx, int type)
&& type != (mtx_try|mtx_recursive))
return thrd_error;
pthread_mutexattr_init(&attr);
- if ((type & mtx_recursive) != 0) {
-#if defined(__linux__) || defined(__linux)
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
-#else
+ if ((type & mtx_recursive) != 0)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-#endif
- }
pthread_mutex_init(mtx, &attr);
pthread_mutexattr_destroy(&attr);
return thrd_success;