[fpc-pascal] cthreads unit
ik
idokan at gmail.com
Sun Feb 17 20:27:13 CET 2008
Thanks, that works.
On Feb 17, 2008 8:50 PM, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
>
> On 17 Feb 2008, at 19:42, ik wrote:
>
> > I'm trying to use the pthread_self function that supposed to be
> > existed at cthreads unit.
> > However the compiler tell me that it does not know "pthread_self".
>
> It's only imported into that unit (in the implementation), it's not
> exported. The cthreads unit only installs a thread manager, it does
> not expose any implementation details (that's the whole point of that
> unit).
>
> > I'm using Linux 64 bit (so I can't use libc), using fpc 2.2.0 .
> > Looking at the source of cthreads.pp, it does have an include for
> > pthread.inc file, that does contain dynamic/static linking of the
> > function, so what am I missing ?
>
> If you want to use the RTL support for threading, use the generic RTL
> routines and not OS-specific ones. There is e.g. a GetCurrentThreadId
> function (but don't count on it returning the same value as
> pthread_self).
>
> If you want to program with pthreads directly, use the pthreads unit
> instead.
>
>
> Jonas
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
--
http://ik.homelinux.org/
More information about the fpc-pascal
mailing list