1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-15 20:39:17 +00:00

Do not wait for the progress mutex to read and store speed timer

This commit is contained in:
jsteube 2016-11-13 00:03:37 +01:00
parent cb6e2107b6
commit f178769863

View File

@ -1925,45 +1925,20 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
if (rc == -1) return -1;
/**
* result
*/
if (user_options->speed_only == false)
{
check_cracked (hashcat_ctx, device_param, salt_pos);
}
/**
* progress
*/
u64 perf_sum_all = (u64) pws_cnt * (u64) innerloop_left;
hc_thread_mutex_lock (status_ctx->mux_counter);
status_ctx->words_progress_done[salt_pos] += perf_sum_all;
hc_thread_mutex_unlock (status_ctx->mux_counter);
/**
* speed
*/
double speed_msec = hc_timer_get (device_param->timer_speed);
const u64 perf_sum_all = (u64) pws_cnt * (u64) innerloop_left;
const double speed_msec = hc_timer_get (device_param->timer_speed);
hc_timer_set (&device_param->timer_speed);
// current speed
//hc_thread_mutex_lock (status_ctx->mux_display);
device_param->speed_cnt[speed_pos] = perf_sum_all;
device_param->speed_msec[speed_pos] = speed_msec;
//hc_thread_mutex_unlock (status_ctx->mux_display);
speed_pos++;
if (speed_pos == SPEED_CACHE)
@ -1971,12 +1946,31 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
speed_pos = 0;
}
/**
* progress
*/
hc_thread_mutex_lock (status_ctx->mux_counter);
status_ctx->words_progress_done[salt_pos] += perf_sum_all;
hc_thread_mutex_unlock (status_ctx->mux_counter);
/**
* benchmark
*/
if (user_options->speed_only == true) break;
/**
* result
*/
if (user_options->speed_only == false)
{
check_cracked (hashcat_ctx, device_param, salt_pos);
}
if (status_ctx->run_thread_level2 == false) break;
}