Fix another threading crash

This commit is contained in:
Jacob Dufault 2017-04-14 17:54:22 -07:00
parent 337c1f0b12
commit f263524b19
2 changed files with 5 additions and 4 deletions

View File

@ -14,6 +14,7 @@
#include "typed_bidi_message_queue.h" #include "typed_bidi_message_queue.h"
#include "working_files.h" #include "working_files.h"
#include <clang-c/Index.h>
#include <doctest/doctest.h> #include <doctest/doctest.h>
#include <rapidjson/istreamwrapper.h> #include <rapidjson/istreamwrapper.h>
#include <rapidjson/ostreamwrapper.h> #include <rapidjson/ostreamwrapper.h>
@ -1512,6 +1513,10 @@ void LanguageServerMain(std::string process_name) {
} }
int main(int argc, char** argv) { int main(int argc, char** argv) {
clang_enableStackTraces();
clang_toggleCrashRecovery(1);
//bool loop = true; //bool loop = true;
//while (loop) //while (loop)
// std::this_thread::sleep_for(std::chrono::milliseconds(10)); // std::this_thread::sleep_for(std::chrono::milliseconds(10));

View File

@ -1437,10 +1437,6 @@ void indexEntityReference(CXClientData client_data,
std::vector<std::unique_ptr<IndexedFile>> Parse(FileConsumer::SharedState* file_consumer_shared, std::string filename, std::vector<std::string> args, bool dump_ast) { std::vector<std::unique_ptr<IndexedFile>> Parse(FileConsumer::SharedState* file_consumer_shared, std::string filename, std::vector<std::string> args, bool dump_ast) {
filename = NormalizePath(filename); filename = NormalizePath(filename);
//return {};
clang_enableStackTraces();
clang_toggleCrashRecovery(1);
clang::Index index(0 /*excludeDeclarationsFromPCH*/, clang::Index index(0 /*excludeDeclarationsFromPCH*/,
0 /*displayDiagnostics*/); 0 /*displayDiagnostics*/);