简体   繁体   中英

C++ Builder 2009 Synchronize

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM