[fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

Michael Van Canneyt michael at freepascal.org
Fri May 30 11:18:35 CEST 2014



On Fri, 30 May 2014, fredvs wrote:

> re-@ Ewald :
>
>>> It *must* be called in the context of the main thread (the thread that
>>> loaded the library)
>
> OOps, so do you mean that CheckSynchronize must be called by Java ?
> So i have to add a "custom" procedure in the fpc library (who will be only a
> fpc CheckSynchronize()) ?
>
> Is it that that you mean, calling CheckSynchronize from the main Java class
> (not from the main thread of the library) ?

It must be called at regular intervals from the main thread of the library.
Whether this is triggered from Java, or you have some loop in your main 
thread that triggers this, is something that is in fact irrelevant for the functioning.

I don't know enough about your architecture to comment on how to do it.
I suspect though, that you will need to make it callable from Java and 
call it at regular intervals from Java code.

Michael.



More information about the fpc-pascal mailing list