Skip to content

Commit

Permalink
boulder/build: Fix runtime drops (double drop)
Browse files Browse the repository at this point in the history
Signed-off-by: Ikey Doherty <[email protected]>
  • Loading branch information
ikeycode committed Mar 3, 2024
1 parent 4acc6c9 commit d6473bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion boulder/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Builder {
root::populate(self, repos)?;
upstream::sync(&self.recipe, &self.paths)?;

rt.destroy();
drop(rt);
// We want to ensure no threads exist before
// cloning into container. Sometimes a deadlock
// occurs which appears related to a race condition
Expand Down
9 changes: 2 additions & 7 deletions moss/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,13 @@ fn destroy() {
drop(rt);
}

/// Drop the Guard to drop the runtime!
#[must_use = "runtime is dropped with guard"]
pub struct Guard;

impl Guard {
pub fn destroy(self) {
destroy();
}
}

impl Drop for Guard {
fn drop(&mut self) {
destroy();
destroy()
}
}

Expand Down

0 comments on commit d6473bd

Please sign in to comment.