
2012/10/23 Vicente J. Botet Escriba <vicente.botet@wanadoo.fr>
Hi,
I have created two tickets to track this possible additions:
https://svn.boost.org/trac/**boost/ticket/7540<https://svn.boost.org/trac/boost/ticket/7540>: Add a helper class that interrupts a thread and join it on destruction https://svn.boost.org/trac/**boost/ticket/7541<https://svn.boost.org/trac/boost/ticket/7541>: Add a thread wrapper class that interrupts and join on destruction
While the scoped_thread class defined in C++ Concurrency in Action is a strict scoped class that doesn't allows any change in the wrapped thread, I think that making the interface thread compatible is also a good option. This doesn't means that a strict scoped thread has no use.
Hi Vicente, The description in the two tickets above do not mention any interruption. thread_guard and scoped_thread only join w/o interruption. Do you intend both to interrupt before join? If "yes", will the names of the two would not be confusing? Name "scoped_thread" is likely (IMHO) to be interpreted that we want to finish for the thread to end in a normal (non-interrupted) way. Perhaps the name should indicate that we want an interruption. If "no", is scoped_thread different from the functionality offered by async? (Given that future's destructor blocks.) Regards, &rzej