http://gwt-code-reviews.appspot.com/1451819/diff/1/user/src/com/google/gwt/core/client/impl/WeakMapping.java
File user/src/com/google/gwt/core/client/impl/WeakMapping.java (right):

http://gwt-code-reviews.appspot.com/1451819/diff/1/user/src/com/google/gwt/core/client/impl/WeakMapping.java#newcode104
user/src/com/google/gwt/core/client/impl/WeakMapping.java:104: for (;;)
{
On 2011/06/16 00:53:37, rjrjr wrote:
why is this tight loop okay? What makes the thread sleep or whatever?

ReferenceQueue#remove() is blocking:
http://download.oracle.com/javase/6/docs/api/java/lang/ref/ReferenceQueue.html#remove()

But I wonder: isn't this change making RequestFactory incompatible with
AppEngine?

There must be a better way.

IIUC, what WeakMapping is trying to do is a WeakHashMap where we
guarantee identity comparison (whichever the actual key, thus whichever
its equals() implementation). Maybe we should mimic WeakHashMap's
internal behavior then: each time you access it, poll() the
ReferenceQueue until it's empty.

http://gwt-code-reviews.appspot.com/1451819/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to