-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the general purpose spin-lock from getrandom, and don't spin when polling /dev/random. We can just use the poll() call itself to have threads wait for /dev/urandom to be safe. We also remove the use of spin locks when opening the persistent fd for platforms that require it. We take an approach similar to unsync_init, but in the very rare case that we open the file twice, we close the unnecessary fd. Signed-off-by: Joe Richey <joerichey@google.com>
- Loading branch information
Showing
3 changed files
with
86 additions
and
94 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
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
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