About: TThread Class   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

The TThread.Synchronize method is available in three overloaded versions (Delphi 2007): private class procedure Synchronize(ASyncRec: PSynchronizeRecord; QueueEvent: Boolean = False); overload; protected procedure Synchronize(AMethod: TThreadMethod); overload; public class procedure Synchronize(AThread: TThread; AMethod: TThreadMethod); overload; * The first version is private and therefore only used internally. * The second version is meant to be called from within the thread object itself. * The third is a class method to be called from outside and therefore needs the thread object as the first parameter. This parameter can be nil, though.

AttributesValues
rdfs:label
  • TThread Class
rdfs:comment
  • The TThread.Synchronize method is available in three overloaded versions (Delphi 2007): <pre> private class procedure Synchronize(ASyncRec: PSynchronizeRecord; QueueEvent: Boolean = False); overload; protected procedure Synchronize(AMethod: TThreadMethod); overload; public class procedure Synchronize(AThread: TThread; AMethod: TThreadMethod); overload;</pre> * The first version is private and therefore only used internally. * The second version is meant to be called from within the thread object itself. * The third is a class method to be called from outside and therefore needs the thread object as the first parameter. This parameter can be nil, though.
dcterms:subject
dbkwik:delphi/prop...iPageUsesTemplate
abstract
  • The TThread.Synchronize method is available in three overloaded versions (Delphi 2007): <pre> private class procedure Synchronize(ASyncRec: PSynchronizeRecord; QueueEvent: Boolean = False); overload; protected procedure Synchronize(AMethod: TThreadMethod); overload; public class procedure Synchronize(AThread: TThread; AMethod: TThreadMethod); overload;</pre> * The first version is private and therefore only used internally. * The second version is meant to be called from within the thread object itself. * The third is a class method to be called from outside and therefore needs the thread object as the first parameter. This parameter can be nil, though. There is also a StaticSynchronize method, that just calls the third version and has the same parameters. The method is used to execute a method in the context of the application's main thread, e.g. to access the (non-threadsafe) VCL. For this it uses a rather complicated approach that on the other hand seems to be faster and more reliable than most other solutions I have seen (in particular it is faster than using PostMessage). The implementation of TThread.Synchronize has changed several times over the years. To avoid a deadlock, you must make sure that your main thread is able to execute its message loop when Synchronize is being called. If that's not possible, call the procedure CheckSynchronize like this: <pre> // Called in the main thread, it is assumed that the // Thread sets SomeThread to nil when it terminates. SomeThread.Terminate; while Assigned(SomeThread) do CheckSynchronize;</pre> (Alternatively you can call SomeThread.WaitFor, the above is just an example.)
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software