Is there anyway to interrupt an std::thread while it's running, call a new method with it, have it return to where it was, and still have it be valid to use with the opengl context, windows etc that it has created?
Asked
Active
Viewed 93 times
0
-
7only by having the thread itself polling some flag – Cheers and hth. - Alf Mar 02 '14 at 13:03
-
Oh, that sucks. Thanks. – Ben Mar 02 '14 at 13:31
-
Apart from the 'call', sounds like a description of normal preemption. – Martin James Mar 02 '14 at 13:36
-
I have a feeling this is a bit of an XY question. If instead of describing your proposed (and in this case flawed) solution X, why not describe the actual problem you are trying to solve? – Mats Petersson Mar 02 '14 at 13:43
-
This is just something that I've thought would be very useful a lot in the past. It's not specific to any one problem. – Ben Mar 02 '14 at 14:00
-
http://en.wikipedia.org/wiki/Producer-consumer_problem – Hans Passant Mar 02 '14 at 14:06