[Lazarus] My daemon no stop under Linux...

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Dec 18 22:49:02 CET 2008


On Thu, 18 Dec 2008 12:11:18 -0500
Liyuán García Caballero <liyuan at cav.desoft.cu> wrote:

> Hi people, I have an application daemon when is sending the signal
> TERM in Unix platform does not end, I attach the code.
> 
>[...]
> procedure Twands.DataModuleStop(Sender: TCustomDaemon; var OK:
> Boolean); begin
>  If Assigned(FThread) then
>     begin
>     FThread.Terminate;
>     // Let the thread die silently.
>     If (FThread<>Nil) then
>       FThread.OnTerminate:=Nil;
>     end;
>   OK:=FThread=Nil;
> end;

FThread.Terminate does not wait until the thread has died.

Check that your thread checks for Terminated=true and ends itself.

Mattias




More information about the Lazarus mailing list