[libc-commits] [libc] [libc] Make 'rand()' thread-safe using atomics instead of TLS (PR #96692)
Roland McGrath via libc-commits
libc-commits at lists.llvm.org
Tue Jun 25 18:02:34 PDT 2024
https://github.com/frobtech approved this pull request.
I agree this is a better approach for this code than `thread_local` or MT-unsafe or locks. The only potential issue is if there are any embedded cases that are purely single-threaded and atomics are not available (or too costly). (For example, on AArch64 you can't use atomics when the MMU is off.)
https://github.com/llvm/llvm-project/pull/96692
More information about the libc-commits
mailing list