Tokay Posted February 10, 2021 Share Posted February 10, 2021 unit Main; //Delphi code interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIRegClasses, uniGUIForm, uniGUIBaseClasses, uniButton; type TTestThread = class(TThread) protected procedure Execute; override; end; TMainForm = class(TUniForm) UniButton1: TUniButton; procedure UniButton1Click(Sender: TObject); private { Private declarations } FThread: TTestThread; procedure OnTerminate(Sender: TObject); public { Public declarations } end; function MainForm: TMainForm; implementation {$R *.dfm} uses uniGUIVars, MainModule, uniGUIApplication; function MainForm: TMainForm; begin Result := TMainForm(UniMainModule.GetFormInstance(TMainForm)); end; procedure TMainForm.OnTerminate(Sender: TObject); begin Sleep(1); //(2) end; procedure TMainForm.UniButton1Click(Sender: TObject); begin FThread := TTestThread.Create(True); FThread.OnTerminate := OnTerminate; FThread.Start; end; { TTestThread } procedure TTestThread.Execute; begin inherited; Sleep(1); //(1) end; initialization RegisterAppFormClass(TMainForm); end. This is the test code. For testing just set break points on the both sleeps. Under windows all works fine: after starting and push the button sleep (1) is activated, then sleep (2). But under Linux sleep (2) doesn't fired at all. In the Lazarus/FPC I fixed the issue with call of CheckSynchronize, but I have no Core sources, and could not run CheckSynchronize synchronously and projects doesn't works. It's critical behavior for our projects! Please, get a look, how is it possible to fix an issue? procedure TService.ManageDaemon; //FPC code begin DoStart; repeat if FDoTerm then Break else { wait a while } Sleep(50); CheckSynchronize; until FDoTerm; DoStop; end; Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted February 10, 2021 Administrators Share Posted February 10, 2021 What is your Delphi version? Quote Link to comment Share on other sites More sharing options...
Tokay Posted February 10, 2021 Author Share Posted February 10, 2021 3 hours ago, Farshad Mohajeri said: What is your Delphi version? Latest licensed 10.4.1 ARCHITECT with all patches: Embarcadero® RAD Studio 10.4 Version 27.0.38860.1461 Copyright © 2020 Embarcadero Technologies, Inc. All Rights Reserved. Quote Link to comment Share on other sites More sharing options...
Tokay Posted February 16, 2021 Author Share Posted February 16, 2021 Up Quote Link to comment Share on other sites More sharing options...
Tokay Posted May 16, 2021 Author Share Posted May 16, 2021 up Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 20, 2021 Administrators Share Posted May 20, 2021 Hi, I think it should be reported to Embarcadero. It can be a debugger issue. Can you try adding debug lines to log file instead? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.