We occour a "no_such_process" system_err on iOS 10.*, when call the std::thread::join() in thread class destructor, but the other iOS systems did not. No cause has been found.
The controller.h sourcecode
// controller.h
class Controller final : public view::ViewCoordinator::Delegate,
public std::enable_shared_from_this {
public:
// ...
private:
// ...
std::shared_ptr worker_thread_;
// ...
}
The controller.cc sourcecode
// controller.cc
// ...
Controller::~Controller() {
PresentScene(nullptr);
worker_thread_.reset();
view_coordinator_.reset();
}
// ...
The thread.h sourcecode
// thread.h
class Thread {
public:
// ***
private:
std::unique_ptr thread_;
// ***
};
The thread.cc sourcecode
// thread.cc
// ...
Thread::~Thread() {
Join();
}
void Thread::Join() {
if (joined_) {
return;
}
joined_ = true;
task_runner_->PostTask([]() { MessageLoop::GetCurrent().Terminate(); });
thread_->join();
}
// ...