Commit graph

3 commits

Author SHA1 Message Date
Markus Handell
2d27b1ab0c Mutex: Temporarily add re-entry CHECK.
Bug: webrtc:11567
Change-Id: I8f9f2f8d2f4961fd82ef50de9f4b486056bc7c1e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176701
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31479}
2020-06-10 07:45:50 +00:00
Mirko Bonadei
b2f73040fc Fix -Wunused-variable error.
Bug: None
Change-Id: I13ca43b15f1519e5ce5c17b6eb0b6611dbd20c39
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176505
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31450}
2020-06-05 08:58:05 +00:00
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