summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Mutex.cpp
diff options
context:
space:
mode:
authorMark Seaborn <mseaborn@chromium.org>2014-01-29 00:20:44 +0000
committerMark Seaborn <mseaborn@chromium.org>2014-01-29 00:20:44 +0000
commitefe919ff8af30f48bb96913311ac16f20c4f9e3a (patch)
treef00327d435b02ea48e672af5a9d02b8a3ea451e4 /llvm/lib/Support/Mutex.cpp
parenteeeb8dafedf4ea6d0882d5e07291d8124582397e (diff)
downloadbcm5719-llvm-efe919ff8af30f48bb96913311ac16f20c4f9e3a.tar.gz
bcm5719-llvm-efe919ff8af30f48bb96913311ac16f20c4f9e3a.zip
Remove unnecessary call to pthread_mutexattr_setpshared()
The default value of this attribute is PTHREAD_PROCESS_PRIVATE, so there's no point in calling pthread_mutexattr_setpshared() to set that. See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutexattr_getpshared.html This removes some ifdefs that tend to need to be extended for other platforms (e.g. for NaCl). Note that this call was in the first implementation of Mutex, added in r22403, so it doesn't appear to have been added in response to a performance problem. Differential Revision: http://llvm-reviews.chandlerc.com/D2633 llvm-svn: 200360
Diffstat (limited to 'llvm/lib/Support/Mutex.cpp')
-rw-r--r--llvm/lib/Support/Mutex.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/llvm/lib/Support/Mutex.cpp b/llvm/lib/Support/Mutex.cpp
index 4e4a026b2f0..37c9d73daee 100644
--- a/llvm/lib/Support/Mutex.cpp
+++ b/llvm/lib/Support/Mutex.cpp
@@ -59,13 +59,6 @@ MutexImpl::MutexImpl( bool recursive)
errorcode = pthread_mutexattr_settype(&attr, kind);
assert(errorcode == 0);
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \
- !defined(__DragonFly__) && !defined(__Bitrig__)
- // Make it a process local mutex
- errorcode = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_PRIVATE);
- assert(errorcode == 0);
-#endif
-
// Initialize the mutex
errorcode = pthread_mutex_init(mutex, &attr);
assert(errorcode == 0);
OpenPOWER on IntegriCloud