[dawn][common] Signal the CondVar before unlocking the mutex. MutexCondVarProtected's guard unlocks the mutex before signaling the condition variable. This means that usage of the condition variable itself is not always protected by the mutex, in particular an other thread could free the memory between mutex.unlock() and cv.signal(). Reorder the members of CondVarGuard to first notify the condition variable and then unlock the mutex. Adds a test that tries to catch the incorrect behavior when running under TSan. Without the fix it reports a warning. Fixed: 517303276 Change-Id: I373bdc4224d90b999199c58c5de0be1ba5f04c47 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/311897 Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
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.