Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/shared/Communication.cpp

Issue 10809053: Terminate the engine if another instance is already running (Closed)
Patch Set: Created June 6, 2013, 1:43 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/engine/main.cpp ('K') | « src/shared/Communication.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/Communication.cpp
===================================================================
--- a/src/shared/Communication.cpp
+++ b/src/shared/Communication.cpp
@@ -130,3 +130,8 @@
if (!WriteFile(pipe, data.c_str(), data.length(), &bytesWritten, 0))
throw std::runtime_error("Failed to write to pipe");
}
+
+bool Communication::PipeExists(const std::wstring& name)
+{
+ return WaitNamedPipe(name.c_str(), 100) || GetLastError() == ERROR_SEM_TIMEOUT;
+}
« src/engine/main.cpp ('K') | « src/shared/Communication.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld