We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
once_cell::Lazy
1 parent 42017e4 commit 4287d0aCopy full SHA for 4287d0a
crates/ark/src/test/dummy_frontend.rs
@@ -12,6 +12,10 @@ use crate::interface::SessionMode;
12
13
// There can be only one frontend per process. Needs to be in a mutex because
14
// the frontend wraps zmq sockets which are unsafe to send across threads.
15
+//
16
+// This is using `Lazy` from the `once_cell` crate instead of other standard
17
+// types because the former provides a way of checking whether it has been
18
+// initialized already.
19
static FRONTEND: Lazy<Arc<Mutex<DummyFrontend>>> =
20
Lazy::new(|| Arc::new(Mutex::new(DummyArkFrontend::init())));
21
0 commit comments