Skip to content

Commit 1ab75fe

Browse files
committed
Add RMain::wait_initialized()
1 parent 75cb32b commit 1ab75fe

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

crates/ark/src/interface.rs

+11
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,17 @@ impl RMain {
490490
R_MAIN_INIT.get().is_some()
491491
}
492492

493+
/// Wait for `RMain` singleton initialization
494+
///
495+
/// Note that R might still not have finished starting up.
496+
/// See `wait_r_initialized()`.
497+
///
498+
/// Thread-safe. But note you can only get access to the singleton on the R
499+
/// thread.
500+
pub fn wait_initialized() {
501+
R_MAIN_INIT.wait();
502+
}
503+
493504
/// Access a reference to the singleton instance of this struct
494505
///
495506
/// SAFETY: Accesses must occur after `start_r()` initializes it, and must

0 commit comments

Comments
 (0)