This is for testing and practice. I’ve global struct which doesn’t need thread safe access to the main object since individual fields are using Mutex. Following is example code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=90dce2819d49555abe2a334e5963b4da
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants --> src/main.rs:21:8 | 21 | w: Mutex::new(100), | ^^^^^^^^^^^^^^^
Is there a way to initialize mutex for the field? Unsafe code solution is acceptable.
Thanks in advance