Fix std::process::get_randstate to not affect random stability (#6550) (#6565)

This commit is contained in:
Aleksander Kiryk
2025-10-16 21:11:07 -04:00
committed by GitHub
parent 982c7fb058
commit 94525cae5d
6 changed files with 153 additions and 98 deletions
+10
View File
@@ -294,6 +294,16 @@ void VL_PRINTF_MT(const char* formatp, ...) VL_MT_SAFE {
}});
}
//===========================================================================
// Process -- parts of std::process implementation
std::string VlProcess::randstate() const VL_MT_UNSAFE {
return VlRNG::vl_thread_rng().get_randstate();
}
void VlProcess::randstate(const std::string& state) VL_MT_UNSAFE {
VlRNG::vl_thread_rng().set_randstate(state);
}
//===========================================================================
// Random -- Mostly called at init time, so not inline.