-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area: apiIssues related to API surfaceIssues related to API surfacetype: enhancementNew feature or requestNew feature or request
Description
The definition of UncapturedErrorHandler
, the callback given to Device::on_uncaptured_error()
, is an alias for
Fn(Error) + Send + 'static
The combination of Fn
, Send
, and no Sync
is weird. I believe that it should be replaced with either:
Fn(Error) + Send + Sync + 'static
implying that the callback could be called simultaneously from multiple threads, where it currently cannot*, or
FnMut(Error) + Send + 'static
allowing the callback to take advantage of not being called simultaneously. This is not a soundness issue, just an unnecessary empty space in between what is permitted for wgpu and what is permitted for its callers.
* Say, what happens if the uncaptured error handler itself performs a wgpu operation that errors? Deadlock? Possibly the error handler ought to be in an Arc
so it can be called outside the lock.
Metadata
Metadata
Assignees
Labels
area: apiIssues related to API surfaceIssues related to API surfacetype: enhancementNew feature or requestNew feature or request