Browse Source

Merge commit 'b942307' into bfgminer

Luke Dashjr 12 years ago
parent
commit
06d137a490
4 changed files with 14 additions and 8 deletions
  1. 12 2
      deviceapi.c
  2. 1 0
      deviceapi.h
  3. 1 1
      driver-x6500.c
  4. 0 5
      miner.c

+ 12 - 2
deviceapi.c

@@ -273,6 +273,16 @@ disabled:
 	}
 	}
 }
 }
 
 
+void mt_disable_start__async(struct thr_info * const mythr)
+{
+	mt_disable_start(mythr);
+	if (mythr->prev_work)
+		free_work(mythr->prev_work);
+	mythr->prev_work = mythr->work;
+	mythr->work = NULL;
+	mythr->_job_transition_in_progress = false;
+}
+
 bool do_job_prepare(struct thr_info *mythr, struct timeval *tvp_now)
 bool do_job_prepare(struct thr_info *mythr, struct timeval *tvp_now)
 {
 {
 	struct cgpu_info *proc = mythr->cgpu;
 	struct cgpu_info *proc = mythr->cgpu;
@@ -349,7 +359,7 @@ void job_results_fetched(struct thr_info *mythr)
 			
 			
 			do_process_results(mythr, &tv_now, mythr->prev_work, true);
 			do_process_results(mythr, &tv_now, mythr->prev_work, true);
 		}
 		}
-		mt_disable_start(mythr);
+		mt_disable_start__async(mythr);
 	}
 	}
 }
 }
 
 
@@ -558,7 +568,7 @@ disabled: ;
 							mythr->_proceed_with_new_job = false;
 							mythr->_proceed_with_new_job = false;
 					}
 					}
 					else  // !mythr->_mt_disable_called
 					else  // !mythr->_mt_disable_called
-						mt_disable_start(mythr);
+						mt_disable_start__async(mythr);
 				}
 				}
 			}
 			}
 			
 			

+ 1 - 0
deviceapi.h

@@ -53,6 +53,7 @@ extern void mt_disable(struct thr_info *);  // blocks until reenabled
 extern int restart_wait(struct thr_info *, unsigned int ms);
 extern int restart_wait(struct thr_info *, unsigned int ms);
 extern void minerloop_scanhash(struct thr_info *);
 extern void minerloop_scanhash(struct thr_info *);
 
 
+extern void mt_disable_start__async(struct thr_info *);
 extern bool do_job_prepare(struct thr_info *, struct timeval *tvp_now);
 extern bool do_job_prepare(struct thr_info *, struct timeval *tvp_now);
 extern void job_prepare_complete(struct thr_info *);
 extern void job_prepare_complete(struct thr_info *);
 extern void do_get_results(struct thr_info *, bool proceed_with_new_job);
 extern void do_get_results(struct thr_info *, bool proceed_with_new_job);

+ 1 - 1
driver-x6500.c

@@ -721,7 +721,7 @@ void x6500_fpga_poll(struct thr_info *thr)
 	x6500_process_results(thr, thr->work);
 	x6500_process_results(thr, thr->work);
 	if (unlikely(!fpga->hashes_left))
 	if (unlikely(!fpga->hashes_left))
 	{
 	{
-		mt_disable_start(thr);
+		mt_disable_start__async(thr);
 		thr->tv_poll.tv_sec = -1;
 		thr->tv_poll.tv_sec = -1;
 	}
 	}
 	else
 	else

+ 0 - 5
miner.c

@@ -9082,11 +9082,6 @@ void mt_disable_start(struct thr_info *mythr)
 		drv->thread_disable(mythr);
 		drv->thread_disable(mythr);
 	
 	
 	hashmeter2(mythr);
 	hashmeter2(mythr);
-	if (mythr->prev_work)
-		free_work(mythr->prev_work);
-	mythr->prev_work = mythr->work;
-	mythr->work = NULL;
-	mythr->_job_transition_in_progress = false;
 	__thr_being_msg(LOG_WARNING, mythr, "being disabled");
 	__thr_being_msg(LOG_WARNING, mythr, "being disabled");
 	mythr->rolling = mythr->cgpu->rolling = 0;
 	mythr->rolling = mythr->cgpu->rolling = 0;
 	thread_reportout(mythr);
 	thread_reportout(mythr);