[fpc-devel] Extension request to TThread extensions
Michael Van Canneyt
michael at freepascal.org
Wed Aug 20 11:12:59 CEST 2014
On Wed, 20 Aug 2014, Michael Schnell wrote:
> I found that my intent to do an "active" extension (or variant) of the Lazarus "NoGUI" Widget Type (aka "Interface") is not possible (to be implemented in an IMHO sensible way) using the released version of the FPC
> RTL, but is rather easy when using the "TThread extensions" provided by the svn version.That is why I will hold off until the next official fpc release.
> A (minor) problem is, that "TThread.Queue", which is the entry to the Thread Queue handling I need to use, is done in perfectly Delphi compatible way in that it does not queue the function call but simply performs a
> call to it when the calling is done from the main thread. While I don't think that this really makes sense, it obviously should stay in place for Delphi compatibility.
> Now, "Application.QueueAsnycCall" should be provided in a way that is perfectly compatible to other Lazarus Widget types. And in Lazarus, "Application.QueueAsnycCall" other than "TThread.Queue" always queues the
> call, even when called from the main thread. Hence using TThread.Queue to implement Application.QueueAsnycCall would introduce a (supposedly very seldom relevant) incompatibility.
> This could be helped by creating another TThread procedure for this purpose.
> Would a patch for such a thing have a chance to be accepted ?
There is no need for a patch.
You can perfectly work around this by implementing Application.QueueAsnycCall so that it creates a thread which does the call to TThread.Queue.
More information about the fpc-devel