diff --git a/api/task_queue/task_queue_test.cc b/api/task_queue/task_queue_test.cc index e78dbd232a..8d02ed6c9e 100644 --- a/api/task_queue/task_queue_test.cc +++ b/api/task_queue/task_queue_test.cc @@ -204,8 +204,10 @@ TEST_P(TaskQueueTest, PostALot) { // So here we post a total of 0xffff+1 messages, which triggers a failure // case inside of the libevent queue implementation. - queue->PostTask( - ToQueuedTask([&event] { event.Wait(rtc::Event::kForever); })); + queue->PostTask(ToQueuedTask([&event] { + rtc::ScopedAllowBaseSyncPrimitivesForTesting allow_base_sync_primitives; + event.Wait(rtc::Event::kForever); + })); for (int i = 0; i < kTaskCount; ++i) queue->PostTask( ToQueuedTask([&tasks_executed] { ++tasks_executed; }, diff --git a/rtc_base/event.h b/rtc_base/event.h index 2e11002066..3f5f8b317c 100644 --- a/rtc_base/event.h +++ b/rtc_base/event.h @@ -49,20 +49,26 @@ class Event { #endif }; -// This class is provided for compatibility with Chromium. +// These classes are provided for compatibility with Chromium. // The rtc::Event implementation is overriden inside of Chromium for the // purposes of detecting when threads are blocked that shouldn't be as well as // to use the more accurate event implementation that's there than is provided // by default on some platforms (e.g. Windows). // When building with standalone WebRTC, this class is a noop. -// For further information, please see the ScopedAllowBaseSyncPrimitives class -// in Chromium. +// For further information, please see the +// ScopedAllowBaseSyncPrimitives(ForTesting) classes in Chromium. class ScopedAllowBaseSyncPrimitives { public: ScopedAllowBaseSyncPrimitives() {} ~ScopedAllowBaseSyncPrimitives() {} }; +class ScopedAllowBaseSyncPrimitivesForTesting { + public: + ScopedAllowBaseSyncPrimitivesForTesting() {} + ~ScopedAllowBaseSyncPrimitivesForTesting() {} +}; + } // namespace rtc #endif // RTC_BASE_EVENT_H_