I'm willing to use a ByteBuffer
to inter thread communication of JNI and C++. I couldn't find in the documentation whether ByteBuffer's getInt()
is blocking or not. So, do I need to do something like:
if(byteBuffer.asIntBuffer().hasRemaining())
byteBuffer.getInt();
Thread.sleep(1000);
or
byteBuffer.getInt();
will block so sleep is unnecessary?