Okay, but the problem with the current implementation in Classes.pas is that Status cannot be used, Terminated cannot be checked, and there is no access to Synchronize. As such OnStatus is pointless, and the semantics of checking Terminated doesn't work. If that's how the these ExecuteInThread class methods on TThread are going work then they should be removed because they don't have significant function and likely would confuse users.
Eg. of confusion when trying to use ExecuteInThread Q: How does OnStatus work? A: It doesn't. Q: How can I check if my thread method is terminated? A: Forget about Thread.Terminated, you'll need to set a flag somewhere or create you own solution. Q: How can I suspend my method and safely join the main thread, because I normally use Synchronize? A: You'll have to do without Synchronize or maybe figure out a workaround. So IMO ExecuteInThread should either be removed or these problems should be fixed.
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal