commit | f4cc537192cae225dc058af03d3b7cb45c9d8a7c | [log] [tgz] |
---|---|---|
author | Kyle Charbonneau <kylechar@google.com> | Mon Jul 07 17:50:24 2025 -0700 |
committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Jul 07 17:50:24 2025 -0700 |
tree | 32da98d0747284873f660657eb935ac9f2cf6dec | |
parent | 5c1d03d6302f3b02573bcbe4ffef1cc501a2cb57 [diff] |
Use vector to hold objects to destroy ApiObjectList::Destroy() moved the objects it is going to destoy to a temporary LinkedList. ApiObjectList::Untrack() returns true if the object is in any list. If another thread runs ApiObjectBase::DeleteThis() at the same time, that sees the objects are in a list and proceeds to remove it from list and then destroy it. This can result in object being removed from list and having DestroyImpl() called on it twice. This is fixed by using a std::vector to track the objects to destroy instead. This avoids the double remove/destruction as ApiObjectList::Destroy() removes all objects from the original list under the lock. Note there is still a problem where the if the last reference is dropped on another thread before ApiObjectList calls DestroyImpl(). The other thread will delete the object resulting in DestroyImpl() being a use-after-free. That is going to fixed as a follow up. Bug: 429112750, 396294899 Change-Id: I9e8a809c653a1565d1dfbb4a7be48c91a644f540 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/251094 Commit-Queue: Kyle Charbonneau <kylechar@google.com> Reviewed-by: Loko Kung <lokokung@google.com>
Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h
that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h
version that Dawn implements.webgpu.h
.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
BSD 3-Clause License, please see LICENSE.
This is not an officially supported Google product.