There is a mismatch between the spec and implementation of sun.nio.ch.NativeThread.current
// Returns an opaque token representing the native thread underlying the
// invoking Java thread. On systems that do not require signalling,
this
// method always returns zero.
//
static native long current();
...
Java_sun_nio_ch_NativeThread_current(JNIEnv *env, jclass cl)
{
#ifdef __linux__
return (long)pthread_self();
#else
return -1;
#endif
...
Which is it, zero or -1?
Please file a bug.
Thanks,
Martin
