projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
propose-patch
[org.ibex.core.git]
/
src
/
org
/
xwt
/
util
/
Queue.java
diff --git
a/src/org/xwt/util/Queue.java
b/src/org/xwt/util/Queue.java
index
a6f0a92
..
8da10d4
100644
(file)
--- a/
src/org/xwt/util/Queue.java
+++ b/
src/org/xwt/util/Queue.java
@@
-1,4
+1,10
@@
-// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+//
+// You may modify, copy, and redistribute this code under the terms of
+// the GNU Library Public License version 2.1, with the exception of
+// the portion of clause 6a after the semicolon (aka the "obnoxious
+// relink clause")
+
package org.xwt.util;
/** A simple synchronized queue, implemented as an array */
package org.xwt.util;
/** A simple synchronized queue, implemented as an array */
@@
-64,17
+70,11
@@
public class Queue {
<tt>block</tt> is true and the queue is empty. */
public synchronized Object remove(boolean block) {
<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--;
Object ret = vec[first];
first++;
size--;