Skip to content

Commit 5a521c1

Browse files
committed
f comment
1 parent 6de3fa3 commit 5a521c1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,9 @@ impl Node {
643643
///
644644
/// After this returns most API methods will return [`Error::NotRunning`].
645645
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.
646649
let mut runtime_lock = self.runtime.write().unwrap();
647650
let runtime = runtime_lock.take().ok_or(Error::NotRunning)?;
648651

0 commit comments

Comments
 (0)