mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 18:00:26 +00:00
Simplify threading model a bit.
This commit is contained in:
parent
4f57b711bb
commit
7741991b72
1060
src/command_line.cc
1060
src/command_line.cc
File diff suppressed because it is too large
Load Diff
@ -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:
|
||||||
|
19
src/ipc.h
19
src/ipc.h
@ -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;
|
||||||
|
@ -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.
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user