From 626ae10d7c90c8a21897343758e5dd0b00016950 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 14 Aug 2011 02:33:55 +1000 Subject: [PATCH] Make sure to give work items a starting time only once when they're staged. --- main.c | 6 +++++- miner.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 25883512..6ca1aa92 100644 --- a/main.c +++ b/main.c @@ -1582,8 +1582,12 @@ static void *stage_thread(void *userdata) } test_work_current(work); - if (!work->cloned && !work->clone) + /* Stage date the work only once since it may be rolled + * or cloned and be staged again */ + if (!work->staged) { gettimeofday(&work->tv_staged, NULL); + work->staged = true; + } if (opt_debug) applog(LOG_DEBUG, "Pushing work to getwork queue"); diff --git a/miner.h b/miner.h index de350339..e9b83a6e 100644 --- a/miner.h +++ b/miner.h @@ -345,6 +345,7 @@ struct work { bool clone; bool cloned; bool rolltime; + bool staged; }; enum cl_kernel {