Author: toad
Date: 2008-06-06 12:24:57 +0000 (Fri, 06 Jun 2008)
New Revision: 20240
Modified:
branches/db4o/freenet/src/freenet/client/FECQueue.java
Log:
Tidy up synchronization (no functional change)
Modified: branches/db4o/freenet/src/freenet/client/FECQueue.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/FECQueue.java 2008-06-06
12:23:53 UTC (rev 20239)
+++ branches/db4o/freenet/src/freenet/client/FECQueue.java 2008-06-06
12:24:57 UTC (rev 20240)
@@ -66,7 +66,7 @@
if(job.persistent) {
container.set(job);
}
- synchronized(FECQueue.this) {
+ synchronized(this) {
if(!job.persistent) {
transientQueue[job.priority].addLast(job);
} else {
@@ -302,20 +302,14 @@
}
}
- public void handleLowMemory() throws Exception {
- synchronized (this) {
- maxRunningFECThreads = Math.min(1, maxRunningFECThreads
- 1);
- notify(); // not notifyAll()
- }
+ public synchronized void handleLowMemory() throws Exception {
+ maxRunningFECThreads = Math.min(1, maxRunningFECThreads - 1);
+ notify(); // not notifyAll()
}
- public void handleOutOfMemory() throws Exception {
- synchronized (this) {
- maxRunningFECThreads = 1;
- notifyAll();
- }
+ public synchronized void handleOutOfMemory() throws Exception {
+ maxRunningFECThreads = 1;
+ notifyAll();
}
-
-
}