tokio-rs / bytes

Utilities for working with bytes
MIT License
1.91k stars 288 forks source link

Add TSAN support #541

Closed Darksonn closed 2 years ago

Darksonn commented 2 years ago

Was previously attempted in #405, but that PR was closed due to TSAN detection being unstable.

Closes: #540

Darksonn commented 2 years ago

Meh, not sure the macro adds that much.

Darksonn commented 2 years ago

Originally I had misspelled #[cfg(sanitize = "thread")] as #[cfg(thread = "sanitize")], which caused it to not work. Unfortunately, when fixing that, it turns out to still be unstable. The current version will always use an acquire load rather than a fence. This is compatible with TSAN. Thoughts?