Martin Buchholz wrote:
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.
A good observation. It should be 0L but as we only need to signal
threads on Linux, it doesn't cause any problems. I've added your mail to
6596323 so that it cna be fixed as part of that bug. Also, I've assigned
myself as RE as it was supposed to have been fixed ages ago.
-Alan.