[fpc-pascal] Initialization in Shared Libraries
pascaldragon at googlemail.com
Wed Apr 13 21:48:11 CEST 2016
On 13.04.2016 21:30, Mazola Winstrol wrote:
> 2016-04-13 15:56 GMT-03:00 Jonas Maebe <jonas.maebe at elis.ugent.be
> <mailto:jonas.maebe at elis.ugent.be>>:
> And hence you can just initialise those variables in the
> initialization section of the library and finalize them (if
> necessary) in the finalization section of the library.
> Can i use class constructors in shared libraries? Does unit's
> initialization section and class constructors have the same behaviour in
> all platforms and the same when compared with a normal program?
Yes and mostly yes. The finalization sections might not be called in the
context of the same thread as the initialization sections, because if
the thread that does the last unload of the library (if it is
dynamically loaded) then it's called in that thread's context. But other
then that they behave the same as for normal programs.
More information about the fpc-pascal