Graphics objects are thread-safe. You do not need to use the main VCL or CLX thread to access TFont, TPen, TBrush, TBitmap, TMetafile (VCL only), TDrawing (CLX only), or TIcon. Canvas objects can be used outside the Synchronize method by locking them.
While list objects are not thread-safe, you can use a thread-safe version, TThreadList, instead of TList.
信仰(250731818) 12:42:10
all objects access their properties and execute their methods within this single thread, you need not worry about your objects interfering with each other.
信仰(250731818) 12:42:21
这是Synchronize的说明
信仰(250731818) 12:42:46
Because Synchronize uses the message loop, it does not work in console applications. You must use other mechanisms, such as critical sections, to protect access to VCL or CLX objects in console applications.
信仰(250731818) 12:42:59
逆看这个
告诉我们Synchronize不是万能的
信仰(250731818) 12:43:11
有时候使用critical section完全可以替代
信仰(250731818) 12:43:28
Synchronize 使用的是消息循环