1
0

Hack to stop thread

This commit is contained in:
Scott E. Graves
2017-03-22 19:02:19 -05:00
parent 4317742f65
commit 5b60aefc8b

View File

@@ -893,7 +893,6 @@ public:
_uploadManager.reset(new CUploadManager(CSiaCurl(_siaApi->GetHostConfig()), _siaDriveConfig)); _uploadManager.reset(new CUploadManager(CSiaCurl(_siaApi->GetHostConfig()), _siaDriveConfig));
_dokanOptions.MountPoint = _mountPoint.ToUpper().str().c_str(); _dokanOptions.MountPoint = _mountPoint.ToUpper().str().c_str();
_mountStatus = DokanMain(&_dokanOptions, &_dokanOps); _mountStatus = DokanMain(&_dokanOptions, &_dokanOps);
OutputDebugString(std::to_wstring(_mountStatus).c_str());
})); }));
} }
} }
@@ -904,6 +903,8 @@ public:
{ {
while (!DokanRemoveMountPoint(&_mountPoint[0])) while (!DokanRemoveMountPoint(&_mountPoint[0]))
::Sleep(1000); ::Sleep(1000);
// HACK - DokanMain() never returns
::TerminateThread(_mountThread->native_handle(), -1);
_mountThread->join(); _mountThread->join();
_mountThread.reset(nullptr); _mountThread.reset(nullptr);
_mountPoint = ""; _mountPoint = "";