[阅读: 776] 2006-08-19 15:20:05
Description
Synchronize causes the call specified by Method to be executed using the main thread, thereby avoiding multi-thread conflicts. If you are unsure whether a method call is thread-safe, call it from within the Synchronize method to ensure that it executes in the main thread.
Execution of the thread current is suspended while Method executes in the main thread.
Warning:
Do not call Synchronize from within the main thread. This can cause an infinite loop.
Note:
You can also protect unsafe methods using critical sections or the multi-read exclusive-write synchronizer.