How to properly pass a handle using core.thread in D? I have tried to do it like this, but the handle will change and I don’t know why:
void WorkerThread(handle hand)
{
…
}
…
auto worker = new Thread( { WorkerThread( m_handle ); } );
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
Threadconstructor can take a delegate that can have context. In the code shown, the context is the enclosing function. If that is a problem for some reason you should be able to do something like this: