1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-05 19:44:21 +00:00

needed flag is currently always false in queue_request. Remove it for now.

This commit is contained in:
Con Kolivas 2012-08-27 09:55:19 +10:00
parent 1b7db5bc9c
commit d1683f75c9

View File

@ -71,7 +71,6 @@ struct workio_cmd {
struct thr_info *thr; struct thr_info *thr;
struct work *work; struct work *work;
struct pool *pool; struct pool *pool;
bool needed;
}; };
struct strategies strategies[] = { struct strategies strategies[] = {
@ -2383,7 +2382,7 @@ out:
return cloned; return cloned;
} }
static bool queue_request(bool needed); static bool queue_request(void);
static void *get_work_thread(void *userdata) static void *get_work_thread(void *userdata)
{ {
@ -2420,7 +2419,7 @@ static void *get_work_thread(void *userdata)
/* pause, then restart work-request loop */ /* pause, then restart work-request loop */
applog(LOG_DEBUG, "json_rpc_call failed on get work, retrying"); applog(LOG_DEBUG, "json_rpc_call failed on get work, retrying");
dec_queued(pool); dec_queued(pool);
queue_request(wc->needed); queue_request();
free_work(ret_work); free_work(ret_work);
goto out; goto out;
} }
@ -2708,7 +2707,7 @@ static void discard_stale(void)
if (stale) { if (stale) {
applog(LOG_DEBUG, "Discarded %d stales that didn't match current hash", stale); applog(LOG_DEBUG, "Discarded %d stales that didn't match current hash", stale);
while (stale-- > 0) while (stale-- > 0)
queue_request(false); queue_request();
} }
} }
@ -3899,7 +3898,7 @@ static void pool_resus(struct pool *pool)
switch_pools(NULL); switch_pools(NULL);
} }
static bool queue_request(bool needed) static bool queue_request(void)
{ {
int ts, tq, maxq = opt_queue + mining_threads; int ts, tq, maxq = opt_queue + mining_threads;
struct pool *pool, *cp; struct pool *pool, *cp;
@ -3911,10 +3910,10 @@ static bool queue_request(bool needed)
return true; return true;
cp = current_pool(); cp = current_pool();
if ((!needed || opt_fail_only) && (cp->staged + cp->queued >= maxq)) if (cp->staged + cp->queued >= maxq)
return true; return true;
pool = select_pool(needed && !ts); pool = select_pool(false);
if (pool->staged + pool->queued >= maxq) if (pool->staged + pool->queued >= maxq)
return true; return true;
@ -3929,7 +3928,6 @@ static bool queue_request(bool needed)
wc->cmd = WC_GET_WORK; wc->cmd = WC_GET_WORK;
wc->pool = pool; wc->pool = pool;
wc->needed = needed;
applog(LOG_DEBUG, "Queueing getwork request to work thread"); applog(LOG_DEBUG, "Queueing getwork request to work thread");
@ -3970,7 +3968,7 @@ static struct work *hash_pop(const struct timespec *abstime)
} }
mutex_unlock(stgd_lock); mutex_unlock(stgd_lock);
queue_request(false); queue_request();
return work; return work;
} }
@ -5720,7 +5718,7 @@ begin_bench:
#endif #endif
for (i = 0; i < mining_threads + opt_queue; i++) for (i = 0; i < mining_threads + opt_queue; i++)
queue_request(false); queue_request();
/* main loop - simply wait for workio thread to exit. This is not the /* main loop - simply wait for workio thread to exit. This is not the
* normal exit path and only occurs should the workio_thread die * normal exit path and only occurs should the workio_thread die