17 Aug
2012
17 Aug
'12
7:29 p.m.
I am attempting to interrupt a blocking stream read. The below code doesn't work since std::istream::read is not a valid boost thread interruption point. Can someone recommend a way to get something like this work work, preferably using boost's cross-platform constructs? Thank you, Chris === void f() { try { char c[999999999]; cin.read(c, 999999999); } catch (boost::thread_interrupted) { } } int main() { boost::thread t(f); f.interrupt(); f.join() return 0; }