HomeFreeBSD

Fix race between first rand(3) calls.

Description

Fix race between first rand(3) calls.

Before this patch there was a chance for thread that called rand(3)
slightly later to see rand3_state already allocated, but not yet
initialized. While this API is not expected to be thread-safe, it
is not expected to crash. ztest on 64-thread system reproduced it
reliably for me.

MFC after: 1 month

Details

Provenance
mavAuthored on Jul 20 2021, 5:15 PM
Parents
rG5a9e5a5111af: nanobsd: fix typo in NANO_WORLDDIR
Branches
Unknown
Tags
Unknown
Reverted By
rG2ae65d449fec: Revert "Fix race between first rand(3) calls."