Commit c8ca4f27 authored by Jason Rhinelander's avatar Jason Rhinelander

crdata: fix thread count problem

Exiting in preload mode wouldn't trigger the thread count decrement;
fixed it by breaking the while loop instead of returning directly.
parent fd4a0914
...@@ -133,7 +133,6 @@ void thr_parse_file( ...@@ -133,7 +133,6 @@ void thr_parse_file(
while (preload_mode || input_it != input_it_end) { while (preload_mode || input_it != input_it_end) {
std::string source; std::string source;
std::unique_ptr<std::stringstream> ss; std::unique_ptr<std::stringstream> ss;
Creativity creativity;
if (preload_mode) { if (preload_mode) {
preload_cv.wait(input_lock, []{ return preload_done || !preload_queue.empty(); }); preload_cv.wait(input_lock, []{ return preload_done || !preload_queue.empty(); });
if (!preload_queue.empty()) { if (!preload_queue.empty()) {
...@@ -152,7 +151,7 @@ void thr_parse_file( ...@@ -152,7 +151,7 @@ void thr_parse_file(
} }
else { else {
// Preloading is finished *and* the queue is empty, so we're done. // Preloading is finished *and* the queue is empty, so we're done.
return; break;
} }
} }
else { else {
...@@ -168,6 +167,7 @@ void thr_parse_file( ...@@ -168,6 +167,7 @@ void thr_parse_file(
std::ostringstream output; std::ostringstream output;
output.precision(args.double_precision); output.precision(args.double_precision);
Creativity creativity;
try { try {
if (preload_mode) // Preloaded input: if (preload_mode) // Preloaded input:
creativity.read<FileStorage>(std::move(ss), FileStorage::Mode::READONLY); creativity.read<FileStorage>(std::move(ss), FileStorage::Mode::READONLY);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment