Lazarus

Free Pascal => Beginners => Topic started by: ThulioGuilherme on August 20, 2016, 10:17:40 pm

Title: Thread synchronization
Post by: ThulioGuilherme on August 20, 2016, 10:17:40 pm
Good night,

Is there a way to stop a thread and after some event start it again without using Thread.Resume and Thread.Suspend?

Without being too specific, I need to get a data from a device and pass it to the thread for processing. For avoid busy waiting, I want to stop the thread and start it when I get the data.

Thanks
Title: Re: Thread synchronization
Post by: Cyrax on August 20, 2016, 10:22:23 pm
See http://www.freepascal.org/docs-html/fcl/syncobjs/teventobject.html
Title: Re: Thread synchronization
Post by: ThulioGuilherme on August 21, 2016, 12:22:54 am
See http://www.freepascal.org/docs-html/fcl/syncobjs/teventobject.html

Thanks for respond. Where I can find a sample code?
TinyPortal © 2005-2018