I need a method to run on the main thread in C++ Builder 2009
. Reading http://docwiki.embarcadero.com/Libraries/XE2/en/System.Classes.TThread.Synchronize it looks like they added the Synchronize
functionality in XE2
. Is there a way to do this in C++ Builder 2009
?
it looks like they added the Synchronize functionality in XE2
I do not know where you got that idea from, but TThread::Synchronize()
has existed in the RTL as long as TThread
itself has existed. Originally Synchronize()
was a non-static
method, so you could only call it from a live TThread
object. A static
version was added in Delphi 7 (during the time when C++Builder was dead, so it did not appear in C++ until C++Builder was resurrected in 2006), and anonymous procedure support was added in Delphi/C++Builder 2009. So, TThread::Synchronize()
, both static and non-static versions, most definitely exists in C++Builder 2009, which you can verify if you look at the declaration of the TThread
class in Classes.hpp
.