[fpc-pascal] PostMessage() from a thread (in a thread save manner)

Graeme Geldenhuys graemeg.lists at gmail.com
Mon Oct 20 20:12:45 CEST 2008


Thanks to everybody that replied...


On Mon, Oct 20, 2008 at 6:43 PM, Lukas Gradl <fpc at ssn.at> wrote:
> I prefer to implement the messaging in the object it belongs to - in this
> case on fpgApplication. The Queue will not be visible from outside, only
> funcions like PostMessage, GetMessage or DiscardMessage. This way you can
> make shure, the lock/unlock sequence will be used correctly...

Yes, this was going to be my next step. I have those functions
stand-alone, which I would like to move into the TfpgApplication class
with the TCriticalSection. Currently the actual message queue is local
to a unit's implementation section, so the only access to it is via
the global methods which have the Lock/Unlock code. But yes,
encapsulating those into TfpgApplication is definitely my next step.


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-pascal mailing list