RTM must to acquire lock before called IsMergedUnsafe (flutter/engine#28514)
I was able to reproduce this on a windows machine with 10000 runs of this test semi-consistently prior to this fix. After this fix it seems to have stopped happening. Fixes: https://github.com/flutter/flutter/issues/88464
This commit is contained in:
@@ -91,7 +91,9 @@ bool RasterThreadMerger::IsOnPlatformThread() const {
|
|||||||
return MessageLoop::GetCurrentTaskQueueId() == platform_queue_id_;
|
return MessageLoop::GetCurrentTaskQueueId() == platform_queue_id_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RasterThreadMerger::IsOnRasterizingThread() const {
|
bool RasterThreadMerger::IsOnRasterizingThread() {
|
||||||
|
std::scoped_lock lock(mutex_);
|
||||||
|
|
||||||
if (IsMergedUnSafe()) {
|
if (IsMergedUnSafe()) {
|
||||||
return IsOnPlatformThread();
|
return IsOnPlatformThread();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class RasterThreadMerger
|
|||||||
// Returns true if the current thread owns rasterizing.
|
// Returns true if the current thread owns rasterizing.
|
||||||
// When the threads are merged, platform thread owns rasterizing.
|
// When the threads are merged, platform thread owns rasterizing.
|
||||||
// When un-merged, raster 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.
|
// Returns true if the current thread is the platform thread.
|
||||||
bool IsOnPlatformThread() const;
|
bool IsOnPlatformThread() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user