ebkalderon / renderdoc-rs

RenderDoc application bindings for Rust
Apache License 2.0
45 stars 6 forks source link

Unimplement Send and Sync for RenderDoc struct #26

Closed ebkalderon closed 5 years ago

ebkalderon commented 5 years ago

Continuing the API soundness and safety investigation from #21, I have determined that the RenderDoc struct should not implement the Send and Sync auto traits because the trigger and stop capture APIs, both the single and multi-frame variants, are inherently serial in design. Having multiple threads attempting to access the entry point simultaneously, potentially interacting with the set_active_window() method to change the focus of the RenderDoc capture layer, is unsound behavior.

Despite being a breaking API change, unimplementing Send and Sync is critical to statically preventing the thread safety issues described above. This should be documented clearly in the CHANGELOG.md so users looking to upgrade may be aware of the change.