<tt>block</tt> is true and the queue is empty. */
public synchronized Object remove(boolean block) {
- while (size == 0) {
- if (!block) return null;
- try {
- wait();
- } catch (InterruptedException e) {
- } catch (Exception e) {
- if (Log.on) Log.log(this, "exception in Queue.wait(); this should never happen");
- if (Log.on) Log.log(this, e);
- }
+ while (size == 0 && block) {
+ try { wait(); } catch (InterruptedException e) { }
}
+ if (!block && size == 0) return null;
Object ret = vec[first];
first++;
size--;