Reland "RTM must to acquire lock before called IsMergedUnsafe (#28514)" (flutter/engine#28581)

This commit is contained in:
Kaushik Iska 2021-09-13 11:44:53 -07:00 committed by GitHub
parent 6bde20b27a
commit 4e77bce9f4
2 changed files with 4 additions and 2 deletions

View File

@ -91,7 +91,9 @@ bool RasterThreadMerger::IsOnPlatformThread() const {
return MessageLoop::GetCurrentTaskQueueId() == platform_queue_id_;
}
bool RasterThreadMerger::IsOnRasterizingThread() const {
bool RasterThreadMerger::IsOnRasterizingThread() {
std::scoped_lock lock(mutex_);
if (IsMergedUnSafe()) {
return IsOnPlatformThread();
} else {

View File

@ -89,7 +89,7 @@ class RasterThreadMerger
// Returns true if the current thread owns rasterizing.
// When the threads are merged, platform thread owns rasterizing.
// When un-merged, raster thread owns rasterizing.
bool IsOnRasterizingThread() const;
bool IsOnRasterizingThread();
// Returns true if the current thread is the platform thread.
bool IsOnPlatformThread() const;