mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 14:29:21 +00:00
During an emergency cleanup, better to not indefinitely wait for
the pipe server to finish. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31241 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2d09fff374
commit
c29028f94c
@ -502,7 +502,12 @@ void LyXComm::closeConnection()
|
||||
return;
|
||||
}
|
||||
|
||||
emergencyCleanup();
|
||||
SetEvent(stopserver_);
|
||||
// Wait for the pipe server to finish
|
||||
WaitForSingleObject(server_thread_, INFINITE);
|
||||
CloseHandle(server_thread_);
|
||||
ResetEvent(stopserver_);
|
||||
CloseHandle(stopserver_);
|
||||
}
|
||||
|
||||
|
||||
@ -510,8 +515,10 @@ void LyXComm::emergencyCleanup()
|
||||
{
|
||||
if (ready_) {
|
||||
SetEvent(stopserver_);
|
||||
// Wait for the pipe server to finish
|
||||
WaitForSingleObject(server_thread_, INFINITE);
|
||||
// Forcibly terminate the pipe server thread if it does
|
||||
// not finish quickly.
|
||||
if (WaitForSingleObject(server_thread_, 200) != WAIT_OBJECT_0)
|
||||
TerminateThread(server_thread_, 0);
|
||||
CloseHandle(server_thread_);
|
||||
ResetEvent(stopserver_);
|
||||
CloseHandle(stopserver_);
|
||||
|
Loading…
Reference in New Issue
Block a user