If Delphi code was written with synchronize to serialize access to the main VCL thread, but this code then is used in a non-VCL application, will it synchronize with the main thread of the application or just have no effect at all?
Example:
procedure TMyThread.Execute;
begin
// ... other code
Synchronize(SomeMethod);
// ...
end;
Let's assume
- it is a non-VCL application which has a main thread which executes in an endless loop (or until terminated)
- the main thread does not call
CheckSynchronize
directly or in a WakeMainThread handler
- a secondary thread runs and executes Synchronize(SomeMethod) like in the example above
Will the thread hang on the Synchronize(SomeMethod) line?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…