Stop FuseThread without using signals

This commit is contained in:
Sebastian Messmer 2019-03-16 17:59:55 -07:00
parent 4b771e85e6
commit ae680a5bdc

View File

@ -29,9 +29,7 @@ void FuseThread::start(const bf::path &mountDir, const vector<string> &fuseOptio
}
void FuseThread::stop() {
if (0 != pthread_kill(_child.native_handle(), SIGINT)) {
throw std::runtime_error("Error sending stop signal");
}
_fuse->stop();
bool thread_stopped = _child.try_join_for(seconds(10));
ASSERT(thread_stopped, "FuseThread could not be stopped");
//Wait until it is properly shutdown (busy waiting is simple and doesn't hurt much here)