Recent

Author Topic: TThread error in mac os  (Read 8733 times)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
TThread error in mac os
« on: October 24, 2007, 09:15:21 am »
Hello,
i'm trying to create a multythreaded application in Mac OS, using lazarus.
When i create a TThread class object, the compiled application won't run and only gives a message window 'Execution stopped'.
even worse, when i try to use CThreads unit the result the same.
is there anything wrong with TThreadManager and Lazarus components?
or may be i should patch up hands.dll?

applications compiled with pure FPC using CThreads are fine.

Paul Ishenin

  • Sr. Member
  • ****
  • Posts: 274
RE: TThread error in mac os
« Reply #1 on: October 25, 2007, 08:42:20 am »
I also had problems with TThread on MacOS, so I dont think your problems in hands.dll :) I workarounded my problem by using carbon function MPCreateTask. You can find example in TCarbonCursor.CreateThread (carbongdiobjects.pp).

And please, create bug report with test application.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
RE: TThread error in mac os
« Reply #2 on: October 25, 2007, 10:41:58 am »
i'm a lazy newbie, please direct me there i can create the bug report.
thanks :)

also, i have found a solution for this. the CThreads unit must be the first one in the uses section (though FPCMacOSall can be earlier).
anyway this cures the error, but still I see no reason for causing such behaviour.

at first i wanted to use MPTasks, but after this error, i have to user FPC beginthread. Anyway MPTasks are based on POSIX threads (according to the Mac OS docs) as well as C threads.
As for the Events and Critical Regions, I'm using objects provided by Carbon, and everything looks nice.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
RE: TThread error in mac os
« Reply #3 on: October 26, 2007, 11:39:40 am »
The reason is because there's no pascal thread library exists for such systems. Read this

Paul Ishenin

  • Sr. Member
  • ****
  • Posts: 274
RE: TThread error in mac os
« Reply #4 on: October 26, 2007, 04:34:38 pm »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: RE: TThread error in mac os
« Reply #5 on: November 08, 2007, 07:59:44 am »
Quote from: "Leledumbo"
The reason is because there's no pascal thread library exists for such systems. Read this

yeap, it's true, there's NO MacOS specific. I guess if anyone writes something like 'CarbonThreadManager' everything will work nicely.
Have anyone ever tried to create his(hers) own thread manager for FPC?

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: RE: TThread error in mac os
« Reply #6 on: November 08, 2007, 08:02:23 am »
Quote from: "PaulIsh"
Bug tracker: http://www.freepascal.org/mantis/


thanks for the link.

 

TinyPortal © 2005-2018