We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6de3fa3 commit 5a521c1Copy full SHA for 5a521c1
src/lib.rs
@@ -643,6 +643,9 @@ impl Node {
643
///
644
/// After this returns most API methods will return [`Error::NotRunning`].
645
pub fn stop(&self) -> Result<(), Error> {
646
+ // We hold the write lock for the duration of this method to avoid any conflicts with
647
+ // inflight tasks when users would potentially concurrently try restart the node before
648
+ // `stop` returned.
649
let mut runtime_lock = self.runtime.write().unwrap();
650
let runtime = runtime_lock.take().ok_or(Error::NotRunning)?;
651
0 commit comments