Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 05a74770ca |
@@ -665,11 +665,10 @@ int send_files_multithreaded(Config* config) {
|
||||
if (config->use_delete)
|
||||
context->manifest = array_list_create(free);
|
||||
|
||||
thrd_t scanner, loader, sender, progress;
|
||||
thrd_t scanner, loader, sender;
|
||||
bool scanner_created = false;
|
||||
bool loader_created = false;
|
||||
bool sender_created = false;
|
||||
bool progress_created = false;
|
||||
|
||||
scanner_created = (thrd_create(&scanner, scan_directory_multithreaded, context) == thrd_success);
|
||||
if (scanner_created)
|
||||
@@ -697,6 +696,8 @@ int send_files_multithreaded(Config* config) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
thrd_t progress;
|
||||
bool progress_created = false;
|
||||
if (config->show_progress) {
|
||||
progress_created = (thrd_create(&progress, progress_thread_fn, context) == thrd_success);
|
||||
if (!progress_created) {
|
||||
@@ -710,7 +711,7 @@ int send_files_multithreaded(Config* config) {
|
||||
thrd_join(loader, NULL);
|
||||
thrd_join(sender, &sender_result);
|
||||
|
||||
if (config->show_progress) {
|
||||
if (progress_created) {
|
||||
/* Signal progress thread to exit if it hasn't already */
|
||||
mtx_lock(&context->mutex_progress);
|
||||
context->sender_done = true;
|
||||
|
||||
@@ -348,6 +348,7 @@ ParallelScanner* parallel_scanner_create(char* root_directory, bool use_metadata
|
||||
ok = false;
|
||||
}
|
||||
if (ok) {
|
||||
// cppcheck-suppress unreadVariable
|
||||
init++;
|
||||
if (cnd_init(&ps->result_not_full) != thrd_success)
|
||||
ok = false;
|
||||
|
||||
@@ -48,6 +48,7 @@ PipelineContextSender* pipeline_context_sender_create(Config* config, Queue* que
|
||||
init++;
|
||||
if (mtx_init(&context->mutex_progress, mtx_plain) != thrd_success)
|
||||
goto fail;
|
||||
// cppcheck-suppress unreadVariable
|
||||
init++;
|
||||
return context;
|
||||
|
||||
@@ -106,6 +107,7 @@ PipelineContextReceiver* pipeline_context_receiver_create(Config* config, Queue*
|
||||
init++;
|
||||
if (cnd_init(&context->condition_not_empty) != thrd_success)
|
||||
goto fail;
|
||||
// cppcheck-suppress unreadVariable
|
||||
init++;
|
||||
return context;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user