Mutex, CriticalSection: Switch Mac to _PTHREAD_MUTEX_POLICY_FIRSTFIT.
Fairshare mutexes performed really badly during a Catalina performance test. This change switches them to use the _PTHREAD_MUTEX_POLICY_FIRSTFIT policy instead. Bug: webrtc:11567, webrtc:11648 Change-Id: I2b8fbe3183beefc26f8d4ff3d63dc6958174605f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176504 Reviewed-by: Tommi <tommi@webrtc.org> Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31456}
This commit is contained in:
parent
17f85b8415
commit
4a4f162f71
@ -43,7 +43,7 @@ CriticalSection::CriticalSection() {
|
||||
pthread_mutexattr_settype(&mutex_attribute, PTHREAD_MUTEX_RECURSIVE);
|
||||
#if defined(WEBRTC_MAC)
|
||||
pthread_mutexattr_setpolicy_np(&mutex_attribute,
|
||||
_PTHREAD_MUTEX_POLICY_FAIRSHARE);
|
||||
_PTHREAD_MUTEX_POLICY_FIRSTFIT);
|
||||
#endif
|
||||
pthread_mutex_init(&mutex_, &mutex_attribute);
|
||||
pthread_mutexattr_destroy(&mutex_attribute);
|
||||
|
||||
@ -29,7 +29,7 @@ class RTC_LOCKABLE MutexImpl final {
|
||||
pthread_mutexattr_init(&mutex_attribute);
|
||||
#if defined(WEBRTC_MAC)
|
||||
pthread_mutexattr_setpolicy_np(&mutex_attribute,
|
||||
_PTHREAD_MUTEX_POLICY_FAIRSHARE);
|
||||
_PTHREAD_MUTEX_POLICY_FIRSTFIT);
|
||||
#endif
|
||||
pthread_mutex_init(&mutex_, &mutex_attribute);
|
||||
pthread_mutexattr_destroy(&mutex_attribute);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user