[fpc-devel] CThreads.pp

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Nov 18 11:43:23 CET 2012


On 16 Nov 2012, at 19:42, Ewald wrote:

> {$mode ObjFPC}, which is the same as cthreads.pp. Removal of the `@`
> doesn't solve the problem. The thing that is weird about this is that
> the type I use for `TThreadID` is not self defined, it comes from one of
> the units used; which somehow is different from some other type that the
> TThreadManager record uses. Is there a way to figure out from where fpc
> gets a certain symbol via command line switch or something?

No. The easiest way to figure this one out is to open the source code in Lazarus, and use its "Find declaration" functionality (by default: position the cursor over an identifier and press alt/option-up).

> Copying the relevant code that is contained in `rtl/darwin/pthread.inc`
> over to  my code seems to fix this issue, logically. I seem to have
> missed the `{$i pthread.inc}` line of the original CThreads.pp. Now, as
> you said, it isn't really a pthread function, but why not putting it in
> pthreads.pp? (thus copy the line {$i pthread.inc} over to pthreads.pp)
> 
> As I see it now, programmers don't have access to the symbols contained
> in the include file, unless they implement them themselves.

The RTL's pthread.inc file only exists for internal RTL usage. Complete header translations under packages are more formally defined and generally should not start mixing in parts from different APIs. FPC indeed currently does not include a proper/full translation of the SYSV semaphore and shared memory APIs.


Jonas


More information about the fpc-devel mailing list