Если бы поток можно было запустить остановленным, то
struct Args { MyClass* cls; std::thread* thread; };
auto args = std::make_shared<Args>();
args->cls = this;
args->thread = new suspened_thread(&MyClass::threadFunc, args);
resume_thread(args->thread);
Но в стандартной библиотеке такого нет, по этому надо использовать какой-нибудь объект синхронизации, например std::future
:
struct Args { MyClass* cls; std::future<std::thread*> thread; };
std::promise<std::thread*> promise;
auto args = std::make_shared<Args>();
args->cls = this;
args->thread = promise.get_future();
promise.set_value(new std::thread(&MyClass::threadFunc, args));
void threadFunc(std::shared_ptr<Args> args) {
auto thread = args->thread.get();
...