Browse Source

Merge branch 'httpsrv' into bfgminer

Luke Dashjr 12 years ago
parent
commit
8a04b54735
3 changed files with 9 additions and 0 deletions
  1. 3 0
      miner.c
  2. 5 0
      util.c
  3. 1 0
      util.h

+ 3 - 0
miner.c

@@ -9607,6 +9607,9 @@ void allocate_cgpu(struct cgpu_info *cgpu, unsigned int *kp)
 		cgpu->thr[j] = thr;
 		cgpu->thr[j] = thr;
 	}
 	}
 	
 	
+	if (!cgpu->device->threads)
+		notifier_init_invalid(cgpu->thr[0]->notifier);
+	else
 	if (!cgpu->threads)
 	if (!cgpu->threads)
 		memcpy(&cgpu->thr[0]->notifier, &cgpu->device->thr[0]->notifier, sizeof(cgpu->thr[0]->notifier));
 		memcpy(&cgpu->thr[0]->notifier, &cgpu->device->thr[0]->notifier, sizeof(cgpu->thr[0]->notifier));
 	else
 	else

+ 5 - 0
util.c

@@ -2691,6 +2691,11 @@ void notifier_read(notifier_t fd)
 #endif
 #endif
 }
 }
 
 
+void notifier_init_invalid(notifier_t fd)
+{
+	fd[0] = fd[1] = INVSOCK;
+}
+
 void notifier_destroy(notifier_t fd)
 void notifier_destroy(notifier_t fd)
 {
 {
 #ifdef WIN32
 #ifdef WIN32

+ 1 - 0
util.h

@@ -173,6 +173,7 @@ typedef SOCKETTYPE notifier_t[2];
 extern void notifier_init(notifier_t);
 extern void notifier_init(notifier_t);
 extern void notifier_wake(notifier_t);
 extern void notifier_wake(notifier_t);
 extern void notifier_read(notifier_t);
 extern void notifier_read(notifier_t);
+extern void notifier_init_invalid(notifier_t);
 extern void notifier_destroy(notifier_t);
 extern void notifier_destroy(notifier_t);
 
 
 /* Align a size_t to 4 byte boundaries for fussy arches */
 /* Align a size_t to 4 byte boundaries for fussy arches */