mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 17:21:51 +00:00
add lock
Signed-off-by: shegangbin <shegangbin1@huawei.com>
This commit is contained in:
parent
ccfdd34517
commit
9f8669d933
@ -549,14 +549,17 @@ void VSyncDistributor::OnVSyncTrigger(int64_t now, int64_t period, uint32_t refr
|
||||
vsyncMode_ = vsyncMode;
|
||||
ChangeConnsRateLocked();
|
||||
|
||||
if (vsyncMode_ == VSYNC_MODE_LTPO) {
|
||||
CollectConnectionsLTPO(waitForVSync, now, conns, event_.vsyncPulseCount);
|
||||
} else {
|
||||
CollectConnections(waitForVSync, now, conns, event_.vsyncCount);
|
||||
}
|
||||
if (!waitForVSync) {
|
||||
DisableVSync();
|
||||
return;
|
||||
{
|
||||
std::lock_guard<std::mutex> locker(mutex_);
|
||||
if (vsyncMode_ == VSYNC_MODE_LTPO) {
|
||||
CollectConnectionsLTPO(waitForVSync, now, conns, event_.vsyncPulseCount);
|
||||
} else {
|
||||
CollectConnections(waitForVSync, now, conns, event_.vsyncCount);
|
||||
}
|
||||
if (!waitForVSync) {
|
||||
DisableVSync();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
countTraceValue_ = (countTraceValue_ + 1) % 2; // 2 : change num
|
||||
|
Loading…
Reference in New Issue
Block a user