mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-02 21:54:10 +08:00
cppcheck stuff
This commit is contained in:
parent
0967ea1989
commit
7c8be44dd6
1 changed files with 16 additions and 11 deletions
|
@ -248,7 +248,9 @@ int thread_start_scheduler(thread_ctx_t *ctx, thread_args_t *t_arg, wu_queue_ctx
|
|||
pthread_mutex_lock(&ctx->thread_mutexs[z]);
|
||||
t_arg[z].status = TH_END;
|
||||
t_arg[z].quit = true;
|
||||
if (cur_status == TH_WAIT) pthread_cond_signal(&ctx->thread_conds[z]);
|
||||
if (cur_status == TH_WAIT) {
|
||||
pthread_cond_signal(&ctx->thread_conds[z]);
|
||||
}
|
||||
pthread_mutex_unlock(&ctx->thread_mutexs[z]);
|
||||
} else {
|
||||
if (ctx->thread_count == 1) {
|
||||
|
@ -306,7 +308,9 @@ int thread_start_scheduler(thread_ctx_t *ctx, thread_args_t *t_arg, wu_queue_ctx
|
|||
printf("[master] thread [%zu], got the signal with new state: %s.\n", z, thread_status_strdesc(t_arg[z].status));
|
||||
fflush(stdout);
|
||||
#endif
|
||||
if (t_arg[z].status == TH_FOUND_KEY) found = true;
|
||||
if (t_arg[z].status == TH_FOUND_KEY) {
|
||||
found = true;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&ctx->thread_mutex_usleep);
|
||||
#if TDEBUG >= 1
|
||||
|
@ -316,17 +320,18 @@ int thread_start_scheduler(thread_ctx_t *ctx, thread_args_t *t_arg, wu_queue_ctx
|
|||
continue;
|
||||
}
|
||||
|
||||
if (found) {
|
||||
// since found is handled before this part (line 237), removing the if-statement
|
||||
// doesn't change anything according to cppcheck.
|
||||
#if TDEBUG >= 1
|
||||
printf("[master] thread [%zu], the key is found. set TH_END from TH_PROCESSING\n", z);
|
||||
fflush(stdout);
|
||||
printf("[master] thread [%zu], the key is found. set TH_END from TH_PROCESSING\n", z);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
pthread_mutex_lock(&ctx->thread_mutexs[z]);
|
||||
t_arg[z].status = TH_END;
|
||||
t_arg[z].quit = true;
|
||||
pthread_mutex_unlock(&ctx->thread_mutexs[z]);
|
||||
continue;
|
||||
}
|
||||
pthread_mutex_lock(&ctx->thread_mutexs[z]);
|
||||
t_arg[z].status = TH_END;
|
||||
t_arg[z].quit = true;
|
||||
pthread_mutex_unlock(&ctx->thread_mutexs[z]);
|
||||
continue;
|
||||
|
||||
}
|
||||
if (cur_status == TH_ERROR) {
|
||||
// something went wrong
|
||||
|
|
Loading…
Reference in a new issue