Browse Source

Merge commit 'f70577b' into bfgminer

Luke Dashjr 13 years ago
parent
commit
8d560e4572
3 changed files with 6 additions and 1 deletions
  1. 2 0
      driver-modminer.c
  2. 3 1
      miner.c
  3. 1 0
      miner.h

+ 2 - 0
driver-modminer.c

@@ -334,6 +334,8 @@ modminer_fpga_init(struct thr_info *thr)
 
 	mutex_unlock(&modminer->device_mutex);
 
+	thr->primary_thread = true;
+
 	return true;
 }
 

+ 3 - 1
miner.c

@@ -3865,6 +3865,8 @@ void *miner_thread(void *userdata)
 	const time_t request_interval = opt_scantime * 2 / 3 ? : 1;
 	unsigned const long request_nonce = MAXTHREADS / 3 * 2;
 	bool requested = false;
+	const bool primary = (!mythr->device_thread) || mythr->primary_thread;
+
 	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
 
 	gettimeofday(&getwork_start, NULL);
@@ -3946,7 +3948,7 @@ void *miner_thread(void *userdata)
 				 * starting of every next thread to try and get
 				 * all devices busy before worrying about
 				 * getting work for their extra threads */
-				if (mythr->device_thread) {
+				if (!primary) {
 					struct timespec rgtp;
 
 					rgtp.tv_sec = 0;

+ 1 - 0
miner.h

@@ -389,6 +389,7 @@ struct thread_q {
 struct thr_info {
 	int		id;
 	int		device_thread;
+	bool		primary_thread;
 
 	pthread_t	pth;
 	struct thread_q	*q;