Browse Source

tq_pop: Remove abstime argument since nothing used it and it wouldn't work anyway (uses CLOCK_REALTIME while we use CLOCK_MONOTONIC[_RAW] when possible)

Luke Dashjr 11 years ago
parent
commit
105489a57f
3 changed files with 4 additions and 7 deletions
  1. 1 1
      driver-opencl.c
  2. 1 1
      miner.h
  3. 2 5
      util.c

+ 1 - 1
driver-opencl.c

@@ -1267,7 +1267,7 @@ void *reinit_gpu(void *userdata)
 
 select_cgpu:
 	sel_cgpu =
-	cgpu = tq_pop(mythr->q, NULL);
+	cgpu = tq_pop(mythr->q);
 	if (!cgpu)
 		goto out;
 

+ 1 - 1
miner.h

@@ -1457,7 +1457,7 @@ extern bool pool_tclear(struct pool *pool, bool *var);
 extern struct thread_q *tq_new(void);
 extern void tq_free(struct thread_q *tq);
 extern bool tq_push(struct thread_q *tq, void *data);
-extern void *tq_pop(struct thread_q *tq, const struct timespec *abstime);
+extern void *tq_pop(struct thread_q *);
 extern void tq_freeze(struct thread_q *tq);
 extern void tq_thaw(struct thread_q *tq);
 extern bool successful_connect;

+ 2 - 5
util.c

@@ -917,7 +917,7 @@ bool tq_push(struct thread_q *tq, void *data)
 	return rc;
 }
 
-void *tq_pop(struct thread_q *tq, const struct timespec *abstime)
+void *tq_pop(struct thread_q * const tq)
 {
 	struct tq_ent *ent;
 	void *rval = NULL;
@@ -927,10 +927,7 @@ void *tq_pop(struct thread_q *tq, const struct timespec *abstime)
 	if (tq->q)
 		goto pop;
 
-	if (abstime)
-		rc = pthread_cond_timedwait(&tq->cond, &tq->mutex, abstime);
-	else
-		rc = pthread_cond_wait(&tq->cond, &tq->mutex);
+	rc = pthread_cond_wait(&tq->cond, &tq->mutex);
 	if (rc)
 		goto out;
 	if (!tq->q)