
Howard Hinnant wrote:
Fair point. Perhaps we should go back to a more fundamental question:
std::thread t(f); ... t.cancel(); // Logically is this a const or non-const operation on the thread executing t/f?
To answer that question probably involves the very definition of cancellation. The "t.cancel()" can reasonably be interpreted in two different ways:
1. Owner to t: I'm no longer interested in your computation (but somebody else might be). 2. Owner to t: I want you to clean-up and stop as soon as possible.
Isn't the first point more in line with what in POSIX threads is described by a 'detach' ? (once a thread is detached, it can't be joined any more. It still can be canceled. Thanks, Stefan -- ...ich hab' noch einen Koffer in Berlin...