Browse Source

Merge commit '7e86813' into bfgminer-4.7.x

Luke Dashjr 11 years ago
parent
commit
d7badc1dce
1 changed files with 8 additions and 1 deletions
  1. 8 1
      deviceapi.c

+ 8 - 1
deviceapi.c

@@ -565,10 +565,15 @@ void minerloop_async(struct thr_info *mythr)
 			}
 			}
 			else  // ! should_be_running
 			else  // ! should_be_running
 			{
 			{
+				if (unlikely(mythr->_job_transition_in_progress && timer_isset(&mythr->tv_morework)))
+				{
+					// Really only happens at startup
+					applog(LOG_DEBUG, "%"PRIpreprv": Job transition in progress, with morework timer enabled: unsetting in-progress flag", proc->proc_repr);
+					mythr->_job_transition_in_progress = false;
+				}
 				if (unlikely((is_running || !mythr->_mt_disable_called) && !mythr->_job_transition_in_progress))
 				if (unlikely((is_running || !mythr->_mt_disable_called) && !mythr->_job_transition_in_progress))
 				{
 				{
 disabled: ;
 disabled: ;
-					timer_unset(&mythr->tv_morework);
 					if (is_running)
 					if (is_running)
 					{
 					{
 						if (mythr->busy_state != TBS_GETTING_RESULTS)
 						if (mythr->busy_state != TBS_GETTING_RESULTS)
@@ -580,6 +585,8 @@ disabled: ;
 					else  // !mythr->_mt_disable_called
 					else  // !mythr->_mt_disable_called
 						mt_disable_start__async(mythr);
 						mt_disable_start__async(mythr);
 				}
 				}
+				
+				timer_unset(&mythr->tv_morework);
 			}
 			}
 			
 			
 			if (timer_passed(&mythr->tv_morework, &tv_now))
 			if (timer_passed(&mythr->tv_morework, &tv_now))