1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-14 03:39:09 +00:00

Get rid of shutdown_inner and shutdown_outer

This commit is contained in:
jsteube 2016-09-28 13:15:23 +02:00
parent c3338f0a9a
commit 171bfbbb8b
6 changed files with 8 additions and 23 deletions

View File

@ -1216,13 +1216,6 @@ typedef struct
user_options_extra_t *user_options_extra;
user_options_t *user_options;
/**
* threads
*/
u32 shutdown_inner;
u32 shutdown_outer;
/**
* hardware watchdog
*/

View File

@ -1772,8 +1772,6 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_
hc_thread_t *inner_threads = (hc_thread_t *) mycalloc (10, sizeof (hc_thread_t));
data.shutdown_inner = 0;
/**
* Outfile remove
*/
@ -1894,8 +1892,6 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_
// wait for inner threads
data.shutdown_inner = 1;
for (uint thread_idx = 0; thread_idx < inner_threads_cnt; thread_idx++)
{
hc_thread_wait (1, &inner_threads[thread_idx]);
@ -2713,8 +2709,6 @@ int main (int argc, char **argv)
hc_thread_t *outer_threads = (hc_thread_t *) mycalloc (10, sizeof (hc_thread_t));
data.shutdown_outer = 0;
if (user_options->keyspace == false && user_options->benchmark == false && user_options->stdout_flag == false)
{
if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK))
@ -2762,8 +2756,6 @@ int main (int argc, char **argv)
// wait for outer threads
data.shutdown_outer = 1;
for (uint thread_idx = 0; thread_idx < outer_threads_cnt; thread_idx++)
{
hc_thread_wait (1, &outer_threads[thread_idx]);

View File

@ -109,7 +109,7 @@ void *thread_monitor (void *p)
u32 remove_left = user_options->remove_timer;
u32 status_left = user_options->status_timer;
while (data.shutdown_inner == 0)
while (opencl_ctx->run_main_level2 == true)
{
hc_sleep (sleep_time);

View File

@ -70,11 +70,11 @@ void *thread_outfile_remove (void *p)
time_t folder_mtime = 0;
int out_cnt = 0;
int out_cnt = 0;
uint check_left = outfile_check_timer; // or 1 if we want to check it at startup
while (data.shutdown_inner == 0)
while (opencl_ctx->run_main_level2 == true)
{
hc_sleep (1);
@ -319,9 +319,9 @@ void *thread_outfile_remove (void *p)
}
}
if (esalt_size) myfree (hash_buf.esalt);
myfree (hash_buf.esalt);
if (is_salted) myfree (hash_buf.salt);
myfree (hash_buf.salt);
myfree (hash_buf.digest);

View File

@ -323,7 +323,7 @@ void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, c
}
// in this case some required buffers are free'd, ascii_digest() would run into segfault
if (data.shutdown_inner == 1) return;
if (opencl_ctx->run_main_level2 == false) return;
if (user_options->machine_readable == true)
{
@ -1158,7 +1158,7 @@ void status_benchmark (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig,
return;
}
if (data.shutdown_inner == 1) return;
if (opencl_ctx->run_main_level2 == false) return;
if (user_options->machine_readable == true)
{

View File

@ -76,7 +76,7 @@ void *thread_keypress (void *p)
tty_break ();
while (data.shutdown_outer == 0)
while (opencl_ctx->run_main_level1 == true)
{
int ch = tty_getchar ();