-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blake3_dispatch: Fix race condition initializing g_cpu_features.
If multiple threads try to compute a hash simultaneously before the library has been used for the first time, the logic in get_cpu_features that detects CPU features will write to g_cpu_features without synchronization, which is a race condition and flagged by ThreadSanitizer. This change marks g_cpu_features as an atomic variable to address the race condition.
- Loading branch information
1 parent
e302cdf
commit 12823b8
Showing
1 changed file
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters