Closed Nekrolm closed 3 days ago
This issue was mentioned before https://github.com/metrics-rs/metrics/issues/171
@Nekrolm Hmm, yeah, I agree. Not sure what my thinking was back then, but it does seem like we might want to require that Recorder
is Sync
. As you put it, this isn't a problem for any sane implementation because they'll be using an approach that is likely already Sync
compatible.
Hi
This is not an issue for any sane implementations, but currently the lack of Sync restrictions makes the
set_global_recorder
unsound: it's possible to create data race in safe codeexample:
Miri output (rustc 1.80):