std::thread::join() throw no_such_process error in iOS 10.*

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();
}

// ...

Replies

I have got same issue. have resolved or any idea ?
no_such_process probably translates to ESRCH. If you burrow through the C++ goo do you find this coming back from pthread_join?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"