[kaffe] gnu.java.nio.VMSelector implementation

Dalibor Topic robilad at kaffe.org
Sun Apr 3 08:07:43 PDT 2005


Am Sonntag, den 03.04.2005, 12:28 +0200 schrieb Michael Koch:
> 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.

I think we could define a specific, negative error code for
helper_select and EINTR and document use that in the class. How about
CLASSPATH_ERROR_SELECT_INTERRUPTED or something like that?

cheers,
dalibor topic
 





More information about the kaffe mailing list