diff --git a/utils/sync_fence/src/sync_fence_timeline.cpp b/utils/sync_fence/src/sync_fence_timeline.cpp index bc3d2cf713..9f339e1676 100644 --- a/utils/sync_fence/src/sync_fence_timeline.cpp +++ b/utils/sync_fence/src/sync_fence_timeline.cpp @@ -45,13 +45,13 @@ ns_sec_t SyncFenceTime::GetSignalTimestamp() } sptr fence; - { - std::lock_guard lock(mutex_); - if (fence_.GetRefPtr() == nullptr) { - return signaledTimestamps_.load(std::memory_order_relaxed); - } - fence = fence_; + + std::lock_guard lock(mutex_); + if (fence_.GetRefPtr() == nullptr) { + return signaledTimestamps_.load(std::memory_order_relaxed); } + fence = fence_; + timestamp = fence->SyncFileReadTimestamp(); if (timestamp != SyncFence::FENCE_PENDING_TIMESTAMP) { @@ -59,7 +59,6 @@ ns_sec_t SyncFenceTime::GetSignalTimestamp() fence_.clear(); signaledTimestamps_.store(timestamp, std::memory_order_relaxed); } - return timestamp; }