[m-rev.] for review: stand-alone interface and non-C grades

Julien Fischer jfischer at opturion.com
Thu Dec 4 22:41:20 AEDT 2014



On Thu, 4 Dec 2014, Paul Bone wrote:

>
>>> Also now I think about it, how are module initialisers and finalisers called
>>> on the Java backend when the Mercury code is used like this?
>>
>> Mercury module initializers are called from static initialization blocks
>> in Java.
>
> Cool.
>
>> Mercury module finalizers are registered with the JavaInternal class
>> in the runtime and can be run by calling jmercury.runtime.JavaInternal.run_finalisers().
>>
>
> It looks as if some things, including the thread pool, arn't initalised if
> you use Mercury as a library.  See JavaInternal.runMain() and the
> JavaInteral constructor.  Static initialisation is probably the best fix.

I'll leave sorting that one out to you.

Looking at the current Java interface samples, we don't currently have
one where Java is called as a library -- I'll add one as we probably
should.

Do you have any comments about the change (that this thread was
originally about) or can I go ahead and commit it?

Cheers,
Julien.



More information about the reviews mailing list