After a bit more research it looks like everyone else uses -

while(checkIfRunning())
{
    // block with timeout
}

which leads me to believe this might not be possible or standard. Although, should something along the lines of this be possible?

Process p = new Process();
p.doTask(p.func()); //create new thread and start function

// do stuff until this needs to exit

p.stop(); // halt running function,
p.cleanup(); // call a clean up function for func's resources
p.kill(); // forcibly kill the thread


If this is possible and/or not a bad idea, how can I accomplish this in D? (And if there isn't really a way, I feel like D's scope(exit) and such should work nicely with it).

Reply via email to