Author: toad
Date: 2009-03-24 16:51:31 +0000 (Tue, 24 Mar 2009)
New Revision: 26162
Modified:
branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java
Log:
Similarly, ensure that these get called inline rather than queued, but they
don't need to be blocking if they are not called from the database thread
Modified: branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java
2009-03-24 16:49:04 UTC (rev 26161)
+++ branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java
2009-03-24 16:51:31 UTC (rev 26162)
@@ -147,6 +147,12 @@
finished = true;
}
if(persistent) {
+ if(container != null) {
+ container.activate(callback, 1);
+ callback.onFailure(container, context);
+ container.deactivate(callback, 1);
+ removeFrom(container, context);
+ } else {
context.jobRunner.queue(new DBJob() {
public void run(ObjectContainer container,
ClientContext context) {
@@ -157,6 +163,7 @@
}
}, NativeThread.HIGH_PRIORITY, false);
+ }
} else {
callback.onFailure(container, context);
}
@@ -179,6 +186,12 @@
fetcher = null;
}
if(persistent) {
+ if(container != null) {
+ container.activate(callback, 1);
+ callback.onFoundEdition(l, key, container,
context, metadata, codec, data);
+ container.deactivate(callback, 1);
+ removeFrom(container, context);
+ } else {
context.jobRunner.queue(new DBJob() {
public void run(ObjectContainer container,
ClientContext context) {
@@ -189,6 +202,7 @@
}
}, NativeThread.HIGH_PRIORITY, false);
+ }
} else {
callback.onFoundEdition(l, key, container, context,
metadata, codec, data);
}
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs