webrtc/rtc_base/synchronization
Tomas Gunnarsson abdb470d00 Make MessageHandler cleanup optional.
As documented in webrtc:11908 this cleanup is fairly invasive and
when a part of a frequently executed code path, can be quite costly
in terms of performance overhead. This is currently the case with
synchronous calls between threads (Thread) as well with our proxy
api classes.

With this CL, all code in WebRTC should now either be using MessageHandlerAutoCleanup
or calling MessageHandler(false) explicitly.

Next steps will be to update external code to either depend on the
AutoCleanup variant, or call MessageHandler(false).

Changing the proxy classes to use TaskQueue set of concepts instead of
MessageHandler. This avoids the perf overhead related to the cleanup
above as well as incompatibility with the thread policy checks in
Thread that some current external users of the proxies would otherwise
run into (if we were to use Thread::Send() for synchronous call).

Following this we'll move the cleanup step into the AutoCleanup class
and an RTC_DCHECK that all calls to the MessageHandler are setting
the flag to false, before eventually removing the flag and make
MessageHandler pure virtual.

Bug: webrtc:11908
Change-Id: Idf4ff9bcc8438cb8c583777e282005e0bc511c8f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183442
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32049}
2020-09-07 12:57:15 +00:00
..
BUILD.gn Migrate rtc_base to webrtc::Mutex. 2020-07-08 20:38:54 +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 Migrate to webrtc::GlobalMutex. 2020-07-15 10:32:20 +00:00
mutex_abseil.h Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
mutex_benchmark.cc Mutex: Temporarily add re-entry CHECK. 2020-06-10 07:45:50 +00:00
mutex_critical_section.h Introduces rtc_base/synchronization/mutex.h. 2020-06-04 09:55:12 +00:00
mutex_pthread.h Mutex, CriticalSection: Switch Mac to _PTHREAD_MUTEX_POLICY_FIRSTFIT. 2020-06-07 15:06:51 +00:00
mutex_unittest.cc Make MessageHandler cleanup optional. 2020-09-07 12:57:15 +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 Migrate rtc_base to webrtc::Mutex. 2020-07-08 20:38:54 +00:00
sequence_checker.h Migrate rtc_base to webrtc::Mutex. 2020-07-08 20:38:54 +00:00
sequence_checker_unittest.cc Add diagnostic printout to RTC_DCHECK_RUN_ON. 2020-06-08 22:29:14 +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