-
Sub-task
-
Resolution: Delivered
-
P4
-
9
-
Verified
The `java.io` classes `CharArrayReader`, `PushbackReader`, and `StringReader` might now block in `close()` if there is another thread holding the `Reader.lock` lock.
The `read()` method of these classes could previously throw a `NullPointerException` if the internal state of the instance had become inconsistent. This was caused by a race condition due to `close()` not obtaining a lock before modifying the internal state of the `Reader`. This lock is now obtained which can result in `close()` blocking if another thread simultaneously holds the same lock on the `Reader`.
The `read()` method of these classes could previously throw a `NullPointerException` if the internal state of the instance had become inconsistent. This was caused by a race condition due to `close()` not obtaining a lock before modifying the internal state of the `Reader`. This lock is now obtained which can result in `close()` blocking if another thread simultaneously holds the same lock on the `Reader`.