From 53e45f6540066115332a1471b98182b3baa82feb Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 14 Apr 2019 08:57:17 -0700 Subject: Added comments about Fence thread safety; minor code improvements --- Graphics/GraphicsEngineVulkan/include/FenceVkImpl.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/include/FenceVkImpl.h b/Graphics/GraphicsEngineVulkan/include/FenceVkImpl.h index 7004d92e..894451e6 100644 --- a/Graphics/GraphicsEngineVulkan/include/FenceVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/FenceVkImpl.h @@ -49,6 +49,11 @@ public: bool IsDeviceInternal = false); ~FenceVkImpl(); + // Note that this method is not thread-safe. The reason is that VulkanFencePool is not thread + // safe, and DeviceContextVkImpl::SignalFence() adds the fence to the pending fences list that + // are signalled later by the command context when it submits the command list. So there is no + // guarantee that the fence pool is not accessed simultaneously by multiple threads even if the + // fence object itself is protected by mutex. virtual Uint64 GetCompletedValue()override final; /// Resets the fence to the specified value. -- cgit v1.2.3