webrtc/rtc_base/synchronization
Markus Handell f70fbc8411 Introduces rtc_base/synchronization/mutex.h.
This change introduces a new non-reentrant mutex to WebRTC. It
enables eventual migration to Abseil's mutex.

The mutex types supportable by webrtc::Mutex are

- absl::Mutex
- CriticalSection (Windows only)
- pthread_mutex (POSIX only)

In addition to introducing the mutexes, the CL also changes
PacketBuffer to use the new mutex instead of rtc::CriticalSection.

The method of yielding from critical_section.cc was given a
mini-cleanup and YieldCurrentThread() was added to
rtc_base/synchronization/yield.h/cc.

Additionally, google_benchmark benchmarks for the mutexes were added
(test courtesy of danilchap@), and some results from a pthread/Abseil
shootout were added showing Abseil has the advantage in higher
contention.

Bug: webrtc:11567, webrtc:11634
Change-Id: Iaec324ccb32ec3851bf6db3fd290f5ea5dee4c81
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176230
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31443}
2020-06-04 09:55:12 +00:00
..
BUILD.gn Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
DEPS Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
mutex.cc Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
mutex.h Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
mutex_abseil.h Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
mutex_benchmark.cc Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
mutex_critical_section.h Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
mutex_pthread.h Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
mutex_unittest.cc Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
rw_lock_posix.cc [Cleanup] Add missing #include. Remove useless ones. 2018-10-23 11:32:56 +00:00
rw_lock_posix.h
rw_lock_win.cc Don't try to load kernel32.dll in RWLockWin class 2019-12-09 18:45:03 +00:00
rw_lock_win.h Don't try to load kernel32.dll in RWLockWin class 2019-12-09 18:45:03 +00:00
rw_lock_wrapper.cc Delete unused includes of assert.h 2018-10-04 14:01:44 +00:00
rw_lock_wrapper.h
sequence_checker.cc Merge of ThreadChecker and SequencedTaskChecker. 2019-03-29 18:53:27 +00:00
sequence_checker.h Add missing RTC_EXPORT for the component build. 2019-10-15 09:07:44 +00:00
sequence_checker_unittest.cc Don't wrap the main thread when running death tests. 2020-05-17 17:15:10 +00:00
yield.cc Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
yield.h Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
yield_policy.cc Add pthread thread-local storage support for ScopedYieldPolicy 2019-07-19 14:33:53 +00:00
yield_policy.h Deleting copy constructors for Scoped* classes. 2019-03-25 09:05:29 +00:00
yield_policy_unittest.cc In rtc_base/ and api/ replace mock macros with unified MOCK_METHOD macro 2020-05-14 19:33:26 +00:00