Recent

Author Topic: TThread class under Linux Ubuntu x64  (Read 3269 times)

drvmotor

  • Newbie
  • Posts: 3
TThread class under Linux Ubuntu x64
« on: May 18, 2014, 01:16:52 pm »
Hello.
The program works well under win7 and xp.
When I tried to compile it under Ubuntu, the following runtime exception has been encountered
Code: [Select]
Semaphore init failed (possibly too many concurrent threads).

Press OK to ignore and risk data corruption.
Press Cancel to kill the program.
After this I have tried to compile separated test,indeed, but that error appeared again.
--
What's wrong?

zeljko

  • Hero Member
  • *****
  • Posts: 1081
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TThread class under Linux Ubuntu x64
« Reply #1 on: May 18, 2014, 01:18:38 pm »
add cthreads unit in your lpr.

drvmotor

  • Newbie
  • Posts: 3
Re: TThread class under Linux Ubuntu x64
« Reply #2 on: May 18, 2014, 02:57:16 pm »
Thanks for fast reply.
cthreads is already included. It was a first matter that I checked.
On the Tthread test I explicitly added contitional define UseCThreads:=1 to avoid any missed  stuff related to subj
--
Oops, wrong!
Now I entirely deleted this conditional checking, UseCThreads, the error disappears.
So, UseCThreads... where it can be defined? Obviously it is a nice feature.
« Last Edit: May 18, 2014, 03:07:41 pm by drvmotor »

Blaazen

  • Hero Member
  • *****
  • Posts: 2782
  • POKE 54296,15
    • Eye-Candy Controls
Re: TThread class under Linux Ubuntu x64
« Reply #3 on: May 18, 2014, 03:05:52 pm »
Quote
UseCThreads:=1
What does this mean?

*.lpr should look like this:
Code: [Select]
{$IFDEF UNIX}{$DEFINE UseCThreads}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
(or remove the ifdef-endif).
Lazarus 2.1.0 r61214:62238 FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

drvmotor

  • Newbie
  • Posts: 3
Re: TThread class under Linux Ubuntu x64
« Reply #4 on: May 18, 2014, 03:14:33 pm »
Quote
UseCThreads:=1
What does this mean?
Project/Project Options/Compiler Options
seems I defined this as conditional but simple define was need

Thanks, the thread is closed