[fpc-pascal] Stack problem in externally called callback function

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Aug 2 20:12:53 CEST 2009

On 02 Aug 2009, at 20:02, Wimpie Nortje wrote:

> Thanks for the response.
> The library uses a centralised function to start all its threads  
> using pthread_create. If I can make this central function inform FPC  
> about all the threads created, would this work?

There is no interface in the RTL to inform it about newly created  
external threads, so it would be quite hard.

> Assuming it would work:  what information would FPC require? When  
> would this info be required, before or after thread creation? What  
> needs to be done on the FPC side with this info?

Look at rtl/unix/cthreads.pp, in the functions CBeginThread/ThreadMain  
and CEndThread (they also call generic code from rtl/inc/thread.inc,  
such as InitThread and DoneThread).


More information about the fpc-pascal mailing list