Initialize ImportPipelineStatus::num_active_threads

This commit is contained in:
Jacob Dufault 2017-12-28 10:21:30 -08:00
parent fd264310c2
commit ad193b2ace
2 changed files with 5 additions and 2 deletions

View File

@ -44,6 +44,8 @@
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
ImportPipelineStatus::ImportPipelineStatus() : num_active_threads(0) {}
// Send indexing progress to client if reporting is enabled. // Send indexing progress to client if reporting is enabled.
void EmitProgress(Config* config) { void EmitProgress(Config* config) {
if (config->enableProgressReports) { if (config->enableProgressReports) {
@ -442,6 +444,7 @@ void IndexMain(Config* config,
Project* project, Project* project,
WorkingFiles* working_files, WorkingFiles* working_files,
MultiQueueWaiter* waiter) { MultiQueueWaiter* waiter) {
auto* queue = QueueManager::instance();
// Build one index per-indexer, as building the index acquires a global lock. // Build one index per-indexer, as building the index acquires a global lock.
ClangIndex index; ClangIndex index;
@ -475,8 +478,6 @@ void IndexMain(Config* config,
status->num_active_threads--; status->num_active_threads--;
auto* queue = QueueManager::instance();
// We didn't do any work, so wait for a notification. // We didn't do any work, so wait for a notification.
if (!did_parse && !did_create_update && !did_merge && !did_load_previous) { if (!did_parse && !did_create_update && !did_merge && !did_load_previous) {
waiter->Wait({&queue->index_request, &queue->on_id_mapped, waiter->Wait({&queue->index_request, &queue->on_id_mapped,

View File

@ -15,6 +15,8 @@ struct WorkingFiles;
struct ImportPipelineStatus { struct ImportPipelineStatus {
std::atomic<int> num_active_threads; std::atomic<int> num_active_threads;
ImportPipelineStatus();
}; };
void IndexWithTuFromCodeCompletion( void IndexWithTuFromCodeCompletion(