From b006e9e64835a101098c3b441a8f6609cbf3f14b Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Thu, 30 Nov 2023 23:02:42 +0900 Subject: [PATCH] save --- scheduler-pool/src/lib.rs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/scheduler-pool/src/lib.rs b/scheduler-pool/src/lib.rs index 1786d0bb422c8e..bac45f6a4efb04 100644 --- a/scheduler-pool/src/lib.rs +++ b/scheduler-pool/src/lib.rs @@ -783,24 +783,29 @@ where } if end_session { - // or should also consider end_thread? log_scheduler!("S:ended"); (state_machine, log_interval) = (SchedulingStateMachine::new(), <_>::default()); drop_sender.send(SessionedMessage::EndSession).unwrap(); result_sender.send(drop_receiver2.recv().unwrap()).unwrap(); - end_session = false; + if !end_thread { + end_session = false; + } } } - log_scheduler!("T:ended"); - drop_sender.send(SessionedMessage::EndSession).unwrap(); - let result_with_timings = drop_receiver2.recv().unwrap(); - trace!( - "solScheduler thread is ended at: {:?}", - std::thread::current() - ); - result_with_timings + log_scheduler!("T:ended"); + if end_session { + (Ok(()), ExecuteTimings::default()) + } else { + drop_sender.send(SessionedMessage::EndSession).unwrap(); + let result_with_timings = drop_receiver2.recv().unwrap(); + trace!( + "solScheduler thread is ended at: {:?}", + std::thread::current() + ); + result_with_timings + } } };