
Matthias I believe that only certain boost thread methods such as sleep can be interrupted. What you could do is a loop that calls select with a timeout and only call a blocking accept when there is socket activity or you could loop with a non-blocking accept. I assume that asio does this much better than what I have described. John Reynolds Aircraft Management Technologies Limited Registered in Ireland, No.337561 Registered office: 1 The Green, Malahide, Co.Dublin, Ireland Tel: + 353 1 8061000 Fax:+ 353 1 8061025 John.Reynolds@flightman.com www.flightman.com THE INFORMATION IN THIS E-MAIL IS CONFIDENTIAL AND MAY BE LEGALLY PRIVILEGED. IT IS INTENDED SOLELY FOR THE ADDRESSEE. ACCESS TO THIS E-MAIL BY ANYONE ELSE IS UNAUTHORISED. IF YOU ARE NOT THE INTENDED RECIPIENT, ANY DISCLOSURE, COPYRIGHT, DISTRIBUTION OR ANY ACTION TAKEN OR OMITTED TO BE TAKEN IN RELIANCE ON IT, IS PROHIBITED AND MAY BE UNLAWFUL. -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Matthias Vallentin Sent: 17 June 2008 10:14 To: boost-users@lists.boost.org Subject: [Boost-users] Interrupting Threads with boost::thread::interrupt() Hi folks, I am having issues with boost::thread::interrupt(). As far as I understood, calling this function will throw an exception in the corresponding thread. How can deal with blocking functions, such as a calls to accept() or when a thread is waiting on a condition variable to change? Basically the thread blocks somewhere in a while (true) loop. Injecting interruption points manually with boost::this_thread::interruption_point() does not seem to help here either. boost::thread::interrupt() (or interrupt_all in a thread_group), simply does not return. Regards, Matthias -- Matthias Vallentin vallentin@icsi.berkeley.edu pgp/gpg: 0x37F34C16 _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users