[fpc-devel] CSuspendThread/CResumeThread
Jonas Maebe
jonas.maebe at elis.ugent.be
Wed Nov 8 11:21:12 CET 2006
On 8 nov 2006, at 11:16, Ales Katona wrote:
> A cleaner naming of problematic parts:
>
> 1. TThreadID is defined stand-alone not as a pthread_t, should be
> fixed.
> 2. TThreadHandler (the callback for resume, suspend) has result as
> DWord
> while posix stuff (pthread_kill etc.) usualy return cInt
> 3. in linux I saw pthreads functions return longint, I think this is
> also investigation worthy.
>
> Question about #1. How should this be handled? Not sure if I can "use"
> unixtypes in sysosh.inc...
No, you probably can't since that would add all those types to the
interface of the system unit. But in my mail I proposed a simple
solution: just do it the other way round (type pthread_t = TThreadID)
> Question about #2. Well.. this is a tough nut? I suspect it's
> because of
> various threading backends, but we need to handle those -1 properly if
> nothing else but this implies going over by all used pthread functions
> and seeing all possible values (which might be OS specific)
A similar solution as TThreadID probably (unless all OSes use signed
results).
> #3 is to be investigated.
Simply replace the longints with cInt. Those declarations are from
before the time we had aliases for ctypes in the RTL.
Jonas
More information about the fpc-devel
mailing list