mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-15 20:25:18 +02:00
Fix shutdown process
This commit is contained in:
parent
991fe88512
commit
f2923d1cb9
|
@ -1139,7 +1139,9 @@ void performStandardExitProcess(string scopeCaller = null) {
|
|||
selectiveSync = null;
|
||||
syncEngineInstance = null;
|
||||
} else {
|
||||
addLogEntry("Application exit", ["debug"]);
|
||||
addLogEntry("Waiting for all servicecs to shutdown");
|
||||
thread_joinAll();
|
||||
addLogEntry("Application exit");
|
||||
addLogEntry("#######################################################################################################################################", ["logFileOnly"]);
|
||||
// Sleep to allow any final logging output to be printed - this is needed as we are using buffered logging output
|
||||
Thread.sleep(dur!("msecs")(500));
|
||||
|
|
|
@ -102,7 +102,7 @@ class MonitorBackgroundWorker {
|
|||
FD_SET((cast()p).readEnd.fileno, &fds);
|
||||
|
||||
res = select(FD_SETSIZE, &fds, null, null, null);
|
||||
|
||||
|
||||
if(res == -1) {
|
||||
if(errno() == EINTR) {
|
||||
// Received an interrupt signal but no events are available
|
||||
|
@ -121,7 +121,6 @@ class MonitorBackgroundWorker {
|
|||
isAlive = receiveOnly!bool();
|
||||
}
|
||||
}
|
||||
callerTid.send(0);
|
||||
}
|
||||
|
||||
shared void interrupt() {
|
||||
|
@ -234,16 +233,9 @@ final class Monitor {
|
|||
initialised = false;
|
||||
// Release all resources
|
||||
removeAll();
|
||||
worker.interrupt();
|
||||
// Notify the worker that the monitor has been shutdown
|
||||
receiveTimeout(dur!"seconds"(-1), (int _) {});
|
||||
worker.interrupt();
|
||||
send(false);
|
||||
// Wait for the worker to terminate
|
||||
int result = 1;
|
||||
while(result == 1) {
|
||||
result = receiveOnly!int();
|
||||
}
|
||||
worker.shutdown();
|
||||
wdToDirName = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue