While merging PushbackInputStream this weekend, I found a bug in both
the Classpath and libgcj versions.  Actually I think it is a a design
bug and not a bug in our implementations.

Suppose a thread calls PushbackInputStream.read and there are no bytes
to be read.  So the thread blocks.

Now suppose another thread calls PushbackInputStream.unread.

Ideally you'd expect the first thread to wake up and read the
pushed-back bytes.  However, this doesn't happen.  And in fact it
isn't easy to make it happen.  I think you could do it by making a new
thread inside PushbackInputStream.read.  That is awfully heavy though.

Maybe the new 1.4 I/O stuff addresses this.

Tom

_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to