]> gerrit.simantics Code Review - simantics/python.git/commitdiff
Mind the threads in writeSCL. 18/318/1
authortkorvola <Timo.Korvola@vtt.fi>
Wed, 1 Feb 2017 17:48:01 +0000 (19:48 +0200)
committertkorvola <Timo.Korvola@vtt.fi>
Wed, 1 Feb 2017 17:50:45 +0000 (19:50 +0200)
Both JNIEnv and PyThreadState are per thread.  So check that we are
in the main thread before messing with JNIEnv.  Writes from other
threads (possibly created in Python) are just dropped; those seem
difficult to do right.

Also unlock GIL while calling the Java method.

Change-Id: I49a447e22ba4411800445f7149f5bc257a082e4f


No differences found