1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-04 19:14:26 +00:00

Revert "Make sure to have at least one staged work item when deciding whether to queue another request or not and dec queued in free work not discard work."

This reverts commit c8601722752bcc6d3db7efd0063f7f2d7f2f7d2a.
This commit is contained in:
Con Kolivas 2012-06-24 21:56:36 +10:00
parent c860172275
commit d2c1a6bd6b

View File

@ -1892,17 +1892,8 @@ static struct work *make_work(void)
return work; return work;
} }
static inline void dec_queued(void)
{
if (likely(total_queued > 0))
total_queued--;
}
static void free_work(struct work *work) static void free_work(struct work *work)
{ {
if (!work->clone)
dec_queued();
free(work); free(work);
} }
@ -2386,8 +2377,17 @@ static inline void inc_queued(void)
total_queued++; total_queued++;
} }
static inline void dec_queued(void)
{
if (likely(total_queued > 0))
total_queued--;
}
static void discard_work(struct work *work) static void discard_work(struct work *work)
{ {
if (!work->clone)
dec_queued();
if (!work->clone && !work->rolls && !work->mined) { if (!work->clone && !work->rolls && !work->mined) {
if (work->pool) if (work->pool)
work->pool->discarded_work++; work->pool->discarded_work++;
@ -3496,7 +3496,7 @@ static bool queue_request(struct thr_info *thr, bool needed)
struct workio_cmd *wc; struct workio_cmd *wc;
if ((total_queued >= opt_queue && rs >= mining_threads) || if ((total_queued >= opt_queue && rs >= mining_threads) ||
(total_queued >= mining_threads && rs)) total_queued >= mining_threads)
return true; return true;
/* fill out work request message */ /* fill out work request message */