[thread] suspend/resume functions

Hello, Currently we can interrupt a thread. Have the functions suspend/resume a sens for a thread? Best regards Vicente

"vicente.botet" <vicente.botet@wanadoo.fr> writes:
Have the functions suspend/resume a sens for a thread?
I don't think so. This is far more dangerous than interruption, since a suspended thread may still hold locks. If you want to suspend a thread, have it check a shared data structure periodically and block with a condition variable if a "suspend" flag is set until that flag becomes clear again. Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
participants (2)
-
Anthony Williams
-
vicente.botet