Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions src/process_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ pub struct ProcessManager {
pub(crate) auto_cleanup: bool,
}

/* ========================================================================== */
/* Construction / configuration */
/* ========================================================================== */

impl ProcessManager {
/// New manager with auto-cleanup of finished children enabled.
pub fn new() -> Self {
Expand Down Expand Up @@ -167,10 +163,6 @@ impl ProcessManager {
}
}

/* ========================================================================== */
/* Runnable implementation */
/* ========================================================================== */

impl Runnable for ProcessManager {
fn process_start(&self) -> ProcFuture<'_> {
let inner = Arc::clone(&self.inner);
Expand Down Expand Up @@ -221,7 +213,7 @@ impl Runnable for ProcessManager {
#[cfg(feature = "tracing")]
{
for child in self.inner.processes.lock().unwrap().iter() {
::tracing::info!(
::tracing::debug!(
"Process {}: running={:?}",
child.proc.process_name(),
!child.join_handle.is_finished()
Expand Down Expand Up @@ -271,9 +263,9 @@ impl Runnable for ProcessManager {
match first_error {
Some(error) => {
#[cfg(feature = "tracing")]
::tracing::info!("Shutdown process manager {name} with error: {error:?}");
::tracing::warn!("Shutdown process manager {name} with error: {error:?}");
#[cfg(all(not(feature = "tracing"), feature = "log"))]
::log::info!("Shutdown process manager {name} with error: {error:?}");
::log::warn!("Shutdown process manager {name} with error: {error:?}");
#[cfg(all(not(feature = "tracing"), not(feature = "log")))]
eprintln!("Shutdown process manager {name} with error: {error:?}");
Err(error)
Expand Down Expand Up @@ -312,10 +304,6 @@ impl Default for ProcessManager {
}
}

/* ========================================================================== */
/* Control Handle */
/* ========================================================================== */

struct Handle {
inner: Arc<Inner>,
}
Expand Down Expand Up @@ -396,10 +384,6 @@ impl ProcessControlHandler for Handle {
}
}

/* ========================================================================== */
/* Helper – spawn a single child */
/* ========================================================================== */

fn spawn_child(id: usize, proc: Arc<dyn Runnable>, inner: Arc<Inner>) -> JoinHandle<()> {
// increment *before* spawning the task – guarantees the counter is in sync
inner.active.fetch_add(1, Ordering::SeqCst);
Expand Down
5 changes: 0 additions & 5 deletions src/runtime_guard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ struct Inner {
control_ch_sender: Arc<Mutex<tokio::sync::mpsc::Sender<RuntimeControlMessage>>>,
}

// SAFETY: All interior mutability is protected by `tokio::sync::Mutex`, so
// `&RuntimeGuard` can be safely shared between threads.
unsafe impl Send for RuntimeGuard {}
unsafe impl Sync for RuntimeGuard {}

impl RuntimeGuard {
pub fn new() -> Self {
let (sender, mut receiver) = tokio::sync::mpsc::channel(1);
Expand Down
3 changes: 0 additions & 3 deletions src/runtime_ticker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ pub struct RuntimeTicker {
control_ch_receiver: Arc<Mutex<tokio::sync::mpsc::Receiver<RuntimeControlMessage>>>,
}

unsafe impl Send for RuntimeTicker {}
unsafe impl Sync for RuntimeTicker {}

impl RuntimeTicker {
pub(crate) fn new() -> (Self, tokio::sync::mpsc::Sender<RuntimeControlMessage>) {
let (sender, receiver) = tokio::sync::mpsc::channel(1);
Expand Down
Loading