Errata

Java Threads

Errata for Java Threads

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 52
on the first code samle block line 5

private flag =new BusyFlag()

should read:

private BusyFlag flag = new BusyFlag()

Anonymous   
Printed Page 89
the code example

In Java Vector is synchronized already, there is no need to write synchronized
methods such as send() and recv() as the book did. The point that the example is
trying to convey is good, but I think the example is bad.

Anonymous   
Printed Page 110-113
Whole pages

Just a question regarding the AsyncInputStream class.

I noticed two things while studying the code for this class:

1. Both of the constructors are protected.
2. There is no asynchronous read methods in this class. All of the read methods call empty.cvWait() if there is no data available t
o be read.

These two things lead me to believe that the authors meant for this class to be subclassed in order to be used properly. However, t
he class needing to be subclassed seems to remove some of the usefulness of this example, and makes the reader need to write code t
o make it actually work as advertised.

Anonymous   
Printed Page 112
run method

in the try block of the run method

try{

...
if ((c==-1) || EOF) {
stmts1
}
...
if (EOF) {
stmts2
}

}
The question is:
Will ever the second if (condition = EOF) be executed? It does not look like to me because of the or used in the first if..
.

Anonymous   
Printed Page 213
In the QueuedBusyFlag class (whole page)

Inconsistent names for the freeBusyFlag and tryGetBusyFlag methods.
In both cases, the example in the book uses a lowercase 'f' in Flag.

public synchronized void freeBusyflag() {

should really be:

public synchronized void freeBusyFlag() {

and:

public synchronized boolean tryGetBusyflag() {

should really be:

public synchronized boolean tryGetBusyFlag() {

This can be verified by usage of this class by the DBAccess class on the
following page which ivokes these methods with a uppercase 'F' in
Flag.

Anonymous   
Printed Page 216
Code sample block after first full paragraph

In the sample code which begins "public class BTree",
the instance variable "lock" is not instantiated before use.
The code should read

public class BTree {
RWLock lock = new RWLock();
....

Anonymous