timob / jnigi

Golang Java JNI library
BSD 2-Clause "Simplified" License
163 stars 44 forks source link

Would appear to be missing UnlockOSThread? #16

Closed yonderblue closed 2 years ago

timob commented 6 years ago

I guess this should be documented that CreateJVM and AttachCurrentThread functions call, runtime.LockOSThread() and that it's the callers responsibility to call runtime.UnlockOSThread().

For CreateJVM you probably are not going to call UnlockOSThread().

For AttachCurrentThread if it's a long lived goroutine calling UnlockOSThread() is needed, but usually it's a short lived goroutine so it doesn't matter that much.

timob commented 3 years ago

I think this probably a good change to have the program code be responsible for runtime.LockOSThread/ runtime.UnlockOSThread.

timob commented 2 years ago

Done!

In version 2.