@@ -254,26 +254,34 @@ pub fn start(td: &mut ThreadData, report: Report, thread_count: usize) {
254254 nodes * pv_stability * eval_stability * score_trend * best_move_stability
255255 } ;
256256
257- if td. time_manager . soft_limit ( td, multiplier) {
258- if !soft_stop_voted {
259- soft_stop_voted = true ;
260-
261- let votes = td. shared . soft_stop_votes . fetch_add ( 1 , Ordering :: AcqRel ) + 1 ;
262- let majority = ( thread_count * 65 ) . div_ceil ( 100 ) ;
263- if votes >= majority {
264- td. shared . status . set ( Status :: STOPPED ) ;
257+ if td. time_manager . use_time_management ( ) {
258+ if td. time_manager . soft_limit ( td, multiplier) {
259+ if !soft_stop_voted {
260+ soft_stop_voted = true ;
261+
262+ let votes = td. shared . soft_stop_votes . fetch_add ( 1 , Ordering :: AcqRel ) + 1 ;
263+ let majority = ( thread_count * 65 ) . div_ceil ( 100 ) ;
264+ if votes >= majority {
265+ td. shared . status . set ( Status :: STOPPED ) ;
266+ }
265267 }
268+ } else if soft_stop_voted {
269+ soft_stop_voted = false ;
270+ td. shared . soft_stop_votes . fetch_sub ( 1 , Ordering :: AcqRel ) ;
266271 }
267- } else if soft_stop_voted {
268- soft_stop_voted = false ;
269- td. shared . soft_stop_votes . fetch_sub ( 1 , Ordering :: AcqRel ) ;
270272 }
271273
272274 if td. shared . status . get ( ) == Status :: STOPPED {
273275 break ;
274276 }
275277 }
276278
279+ if matches ! ( td. time_manager. limits( ) , Limits :: Infinite ) {
280+ while td. shared . status . get ( ) != Status :: STOPPED {
281+ std:: hint:: spin_loop ( ) ;
282+ }
283+ }
284+
277285 if report == Report :: Minimal {
278286 td. print_uci_info ( td. root_depth ) ;
279287 }
0 commit comments