Skip to content

Put random() state behind mutex

Peter Limkilde Svendsen requested to merge plimkilde/relibc:random-mutex into master

This puts the state of random() and related functions behind a mutex, similar to the musl implementation.

Raw pointers (in this case x_ptr) are not Send in Rust, so I had to manually implement Send for the state struct. There should otherwise be no particularly dirty hacks.

Marking as draft for now due to a mysterious forkpty error in tests. Should be fixed after a rebase past !494 (merged). However, this also includes some formatting issues originating in !492 (merged). Formatting now fixed.

Edited by Peter Limkilde Svendsen

Merge request reports