[Lazarus] Class TThread in linux;

Sven Barth pascaldragon at googlemail.com
Fri Nov 25 14:30:01 CET 2011


Am 25.11.2011 11:17, schrieb William Oliveira Ferreira:
> Why should set $define usecthreads? only $ifdef linux doesn´t solve the
> issue?

The default projects of Lazarus contain the following code:

uses
   {$ifdef unix}{$ifdef usecthreads}
   cthreads,
   {$endif}{$endif}
   ...

The "cthreads" unit is the one that must be included for threading 
support on Unix systems. Using a linux system merely satisfies the 
"ifdef unix" condition, but you need to define "usecthreads" as well or 
remove the check completely (you should leave the check for Unix though 
as the "cthreads" unit is not available for e.g. Windows).

Regards,
Sven





More information about the Lazarus mailing list