[kaffe] gnu.java.nio.VMSelector implementation
Michael Koch
konqueror at gmx.de
Sun Apr 3 03:28:42 PDT 2005
On Sun, Apr 03, 2005 at 05:04:32PM +0900, Rei Odaira wrote:
> --- libraries/clib/nio/gnu_java_nio_VMSelector.c 1 Apr 2005 01:02:56 -0000 1.5
> +++ libraries/clib/nio/gnu_java_nio_VMSelector.c 3 Apr 2005 07:24:27 -0000
> @@ -166,7 +166,7 @@
> /* Here we know we got EINTR. */
> if ( (*env)->CallStaticBooleanMethod(env, thread_class, thread_interrupted) )
> {
> - return EINTR;
> + return -2;
> }
>
> if (timeout)
> @@ -249,7 +249,7 @@
> result = helper_select (env, thread_class, thread_interrupted, max_fd + 1, &read_fds, &write_fds,
> &except_fds, time_data);
>
> - if( result == EINTR ) {
> + if( result == -2 ) {
> /* The behavior of JRE 1.4.1 is that no exception is thrown
> * when the thread is interrupted, but the thread's interrupt
> * status is set. Clear all of our select sets and return 0,
Why do you do these? Using cryptic values withoud documenting it is at
least not good for maintaining the code? What does the -2 stands for?
We should use constant names wherever possible to make it easier to port
the code to other archs. E.g. On my Linux EINTR has the value "4" and
not "-2". So this change looks just plain wrong for Linux.
Michael
--
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
Join the community at http://planet.classpath.org/
More information about the kaffe
mailing list