DEV Community

Discussion on: Calling Rust from C#

Collapse
 
pepyakin profile image
Sergey Pepyakin

Did you tried to use thread_local! instead of static mut?

Collapse
 
living_syn profile image
Jeremy Mill

Nope, I'll look into it though. Thanks!

Collapse
 
someperson2 profile image
SomePerson2

Yeah. And static mut is pretty much almost always unneeded, since there is a safe way to do this, with interior mutability. (I'm coming from the future, but there are apis like OnceLock, LazyLock, etc)