On 25.10.2016 14:07, LacaK via Lazarus wrote:
Yes this can happen.
MyForm.MyMethod is called also from event handler and also is used in
Synchronize(@MyForm.MyMethod)
How can this happen/play role?
I suppose by "event handler" you mean a GUI event (Mouse, Keyboard, ...)
Such events are servic
On Wed, 26 Oct 2016 20:23:11 +0200
Sascha Hestermann via Lazarus wrote:
> Am 26.10.2016 um 12:02 schrieb LacaK via Lazarus:
> > Btw. when TTimer is executing OnTimer method, which does not finishes
> > until next Interval is elapsed, is again called OnTimer ? Or next
> > OnTimer is performed only
Am 26.10.2016 um 12:02 schrieb LacaK via Lazarus:
> Btw. when TTimer is executing OnTimer method, which does not finishes
> until next Interval is elapsed, is again called OnTimer ? Or next
> OnTimer is performed only when prior OnTimer finished ?
Afaik TTimer periodically sends a message to the e
On 26.10.2016 12:02, LacaK via Lazarus wrote:
you just could use TTimer.
probably yes. I do not remember why I have used thread for it. May be
I do not wanted dependency on ExtCtrls ...
Btw. when TTimer is executing OnTimer method, which does not finishes
until next Interval is elapsed, is
Dňa 26.10.2016 o 11:17 Michael Schnell via Lazarus napísal(a):
On 26.10.2016 07:57, LacaK via Lazarus wrote:
procedure TRefreshFileListThread.Execute;
begin
while not Terminated do begin
Synchronize(@MyForm.UpdateFileList); // UpdateFileList is method
which clears listbox and then adds fi
On 26.10.2016 07:57, LacaK via Lazarus wrote:
procedure TRefreshFileListThread.Execute;
begin
while not Terminated do begin
Synchronize(@MyForm.UpdateFileList); // UpdateFileList is method
which clears listbox and then adds files in given shared folder
Sleep(1);
end;
This only m
Big Thanks to all. Now I understand what is happening ... probably I wil
use critical section to block access from thread when code in main
thread is performed ...
-Laco.
ShowModal() for a modal form will call it.
[...]
I did test in Delphi and Delphi seems also perform synchronize upon
Sho
On Wed, 26 Oct 2016 09:49:44 +0200
LacaK via Lazarus wrote:
> >>> ShowModal() for a modal form will call it.
>[...]
> I did test in Delphi and Delphi seems also perform synchronize upon
> ShowModal
Yes.
> > Nowhere is it stated or guaranteed that synchronisation cannot happen
> > in a GUI
ShowModal() for a modal form will call it.
Ah really?
It happens in my application!
Then that is your problem.
:-)))
But is it correct behavior ? IMO it is against thread safety, which
should Synchronize guarantee!
The two issues are completely unrelated. The current behaviour is
co
On Wed, 26 Oct 2016, LacaK via Lazarus wrote:
Check for Application.ProcessMessages and CheckSynchronize calls.
These process synchronize queue, if I am not mistaken.
I do not call CheckSynchronize nor ProcessMessages in my application.
So only any LCL component or widget set can call
Check for Application.ProcessMessages and CheckSynchronize calls.
These process synchronize queue, if I am not mistaken.
I do not call CheckSynchronize nor ProcessMessages in my application.
So only any LCL component or widget set can call it in background ?
ShowModal() for a modal form
On Tue, 25 Oct 2016 15:02:06 +0200
LacaK via Lazarus wrote:
> >> I do not call CheckSynchronize nor ProcessMessages in my application.
> >> So only any LCL component or widget set can call it in background ?
> >
> > It should be easy for you to set a breakpoint into MyForm.MyMethod and
> > che
On Tue, 25 Oct 2016 13:37:03 +0200
Michael Schnell via Lazarus wrote:
> > If you don't call CheckSynchronize within MyForm.MyMethod then yes.
> IMHO the (hardly documented) CheckSynchronize should not be called
> directly by an application that uses a Widget Type that features an
> Event Que
I do not call CheckSynchronize nor ProcessMessages in my application.
So only any LCL component or widget set can call it in background ?
It should be easy for you to set a breakpoint into MyForm.MyMethod and
check the call stack.
But error (AV) happens only in production and only sometime
On Tue, 25 Oct 2016, LacaK via Lazarus wrote:
Check for Application.ProcessMessages and CheckSynchronize calls.
These process synchronize queue, if I am not mistaken.
I do not call CheckSynchronize nor ProcessMessages in my application.
So only any LCL component or widget set can call it i
On 25.10.2016 14:12, LacaK via Lazarus wrote:
I do not call CheckSynchronize nor ProcessMessages in my application.
So only any LCL component or widget set can call it in background ?
It should be easy for you to set a breakpoint into MyForm.MyMethod and
check the call stack.
Ondrej
--
_
Check for Application.ProcessMessages and CheckSynchronize calls.
These process synchronize queue, if I am not mistaken.
I do not call CheckSynchronize nor ProcessMessages in my application.
So only any LCL component or widget set can call it in background ?
From Delphi doc:
"Synchronize c
Check for Application.ProcessMessages and CheckSynchronize calls.
These process synchronize queue, if I am not mistaken.
I do not call CheckSynchronize nor ProcessMessages in my application.
So only any LCL component or widget set can call it in background ?
-Laco.
--
___
My understanding is that, Synchronize schedules execution of
MyForm.MyMethod to main thread, so method is not executed until
control is returned from event handler in MyForm. Right?
TThread.Synchronze pushes the procedure that is given as a parameter
(including it's Self pointer) to the even
If you don't call CheckSynchronize within MyForm.MyMethod then yes.
IMHO the (hardly documented) CheckSynchronize should not be called
directly by an application that uses a Widget Type that features an
Event Queue. Here the user should do "Application.ProcessMessages", that
is decently docu
On 25.10.2016 13:21, LacaK via Lazarus wrote:
My understanding is that, Synchronize schedules execution of
MyForm.MyMethod to main thread, so method is not executed until
control is returned from event handler in MyForm. Right?
TThread.Synchronze pushes the procedure that is given as a paramete
On 25.10.2016 13:21, LacaK via Lazarus wrote:
I have form on which is button. When user clicks button OnClick event
handler is called (it is method of form). Processing of this method
takes some time say 1 minute.
In the background is operating another thread which every 10 seconds
calls Synchr
22 matches
Mail list logo