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