Simplify threading model a bit.

This commit is contained in:
Jacob Dufault 2017-04-23 13:19:09 -07:00
parent 4f57b711bb
commit 7741991b72
5 changed files with 515 additions and 573 deletions

File diff suppressed because it is too large Load Diff

View File

@ -43,12 +43,6 @@ const char* IpcIdToString(IpcId id) {
return "$cquery/freshenIndex"; return "$cquery/freshenIndex";
} }
case IpcId::Quit:
return "$quit";
case IpcId::IsAlive:
return "$isAlive";
case IpcId::OpenProject:
return "$openProject";
case IpcId::Cout: case IpcId::Cout:
return "$cout"; return "$cout";
default: default:

View File

@ -29,9 +29,6 @@ enum class IpcId : int {
CqueryFreshenIndex, CqueryFreshenIndex,
// Internal implementation detail. // Internal implementation detail.
Quit,
IsAlive,
OpenProject,
Cout Cout
}; };
MAKE_ENUM_HASHABLE(IpcId) MAKE_ENUM_HASHABLE(IpcId)
@ -48,22 +45,6 @@ struct IpcMessage : public BaseIpcMessage {
IpcMessage() : BaseIpcMessage(T::kIpcId) {} IpcMessage() : BaseIpcMessage(T::kIpcId) {}
}; };
struct Ipc_Quit : public IpcMessage<Ipc_Quit> {
static constexpr IpcId kIpcId = IpcId::Quit;
};
MAKE_REFLECT_EMPTY_STRUCT(Ipc_Quit);
struct Ipc_IsAlive : public IpcMessage<Ipc_IsAlive> {
static constexpr IpcId kIpcId = IpcId::IsAlive;
};
MAKE_REFLECT_EMPTY_STRUCT(Ipc_IsAlive);
struct Ipc_OpenProject : public IpcMessage<Ipc_OpenProject> {
static constexpr IpcId kIpcId = IpcId::OpenProject;
std::string project_path;
};
MAKE_REFLECT_STRUCT(Ipc_OpenProject, project_path);
struct Ipc_Cout : public IpcMessage<Ipc_Cout> { struct Ipc_Cout : public IpcMessage<Ipc_Cout> {
static constexpr IpcId kIpcId = IpcId::Cout; static constexpr IpcId kIpcId = IpcId::Cout;
std::string content; std::string content;

View File

@ -149,8 +149,6 @@ std::string NormalizePath(const std::string& path) {
} }
bool TryMakeDirectory(const std::string& absolute_path) { bool TryMakeDirectory(const std::string& absolute_path) {
std::cerr << "!! TryMakeDirectory " << absolute_path << std::endl;
const mode_t kMode = 0777; // UNIX style permissions const mode_t kMode = 0777; // UNIX style permissions
if (mkdir(absolute_path.c_str(), kMode) == -1) { if (mkdir(absolute_path.c_str(), kMode) == -1) {
// Success if the directory exists. // Success if the directory exists.

View File

@ -150,7 +150,6 @@ std::string NormalizePath(const std::string& path) {
} }
bool TryMakeDirectory(const std::string& absolute_path) { bool TryMakeDirectory(const std::string& absolute_path) {
std::cerr << "!! TryMakeDirectory " << absolute_path << std::endl;
if (_mkdir(absolute_path.c_str()) == -1) { if (_mkdir(absolute_path.c_str()) == -1) {
// Success if the directory exists. // Success if the directory exists.
return errno == EEXIST; return errno == EEXIST;