-
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. Now the only use of spin locks is to make sure open() is called exactly once when a file is used to get random data. This is fine, as the open() syscall will never block when opening a device, unlike read/writes which can obviously block. Signed-off-by: Joe Richey <joerichey@google.com>
- Loading branch information
Showing
3 changed files
with
100 additions
and
93 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