TThread doesn't work :( lazarus / 1-Linux ---------------------------------------------------------------------- micro_cz · 2007-06-10 08:10 Hi, i have been trying to get tthread work for three days but no effect I have read almost all questions in this forum and lazarus multithreaded application tutorial, but nothing has helped me . as was mentioned in tutorial i have in project file: uses   {$IFDEF UNIX}{$IFDEF UseCThreads}   cthreads,   {$ENDIF}{$ENDIF}     this is my child of tthread:   CBrowserThread = class(TThread)   protected     procedure execute(); override;   end;   an this is how i create it:     showMessage('test1');   browserThread := CBrowserThread.create(TRUE);   showMessage('test2');   browserThread.resume; but after creation of thread application will end, message test1 will show, but test2 will not ---------------------------------------------------------------------- vaso · 2007-06-11 12:07 Quote from: "micro_cz"Hi, i have been trying to get tthread work for three days but no effect I have read almost all questions in this forum and lazarus multithreaded application tutorial, but nothing has helped me . as was mentioned in tutorial i have in project file: uses   {$IFDEF UNIX}{$IFDEF UseCThreads}   cthreads,   {$ENDIF}{$ENDIF}     this is my child of tthread:   CBrowserThread = class(TThread)   protected     procedure execute(); override;   end;   an this is how i create it:     showMessage('test1');   browserThread := CBrowserThread.create(TRUE);   showMessage('test2');   browserThread.resume; but after creation of thread application will end, message test1 will show, but test2 will not I have the same issue under the Mac OS X. When I used dayly snapshot 20070524 - threads were working fine. But when I downloaded and installed 20070604 and later - threads became broken. ---------------------------------------------------------------------- Vincent Snijders · 2007-06-11 12:17 micro_cz, vaso, what fpc version do you use? ---------------------------------------------------------------------- theo · 2007-06-11 12:17 Is UseCThreads defined in your case? If not just remove this ifdef. ---------------------------------------------------------------------- Vincent Snijders · 2007-06-11 12:53 Jonas (Mac OS X fpc developer) successfully run this code with fpc 2.1.5: Code: [Select]{$mode objfpc} uses cthreads,classes; type CBrowserThread = class(TThread) protected procedure execute(); override; end; procedure CBrowserThread.execute; begin end; var   browserthread: CBrowserThread; begin   writeln('test1');   browserThread := CBrowserThread.create(TRUE);   writeln('test2');   browserThread.resume; end. ---------------------------------------------------------------------- micro_cz · 2007-06-12 12:01 ok thanks i have fpc-src_2.0.4-1_i386 i'll try 2.1.5 ---------------------------------------------------------------------- micro_cz · 2007-06-12 12:54 i've found only 2.1.4 with this version  my app behaves same, after calling CBrowserThread.create(TRUE); application ends ---------------------------------------------------------------------- felipemdc · 2007-06-12 14:11 This forum is mostly dedicated to lazarus ide and lazarus component library issues. This is mostly a compiler/rtl issue. You will receive more specialized help if you post this on the Free Pascal mailling list: http://www.freepascal.org/maillist.var