labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r679396 - in /labs/droids/trunk/src/core/java/org/apache/droids: DefaultCrawler.java DefaultWorker.java
Date Thu, 24 Jul 2008 12:40:39 GMT
Author: thorsten
Date: Thu Jul 24 05:40:38 2008
New Revision: 679396

URL: http://svn.apache.org/viewvc?rev=679396&view=rev
Log:
Removing the usages of synchronized where possible

Modified:
    labs/droids/trunk/src/core/java/org/apache/droids/DefaultCrawler.java
    labs/droids/trunk/src/core/java/org/apache/droids/DefaultWorker.java

Modified: labs/droids/trunk/src/core/java/org/apache/droids/DefaultCrawler.java
URL: http://svn.apache.org/viewvc/labs/droids/trunk/src/core/java/org/apache/droids/DefaultCrawler.java?rev=679396&r1=679395&r2=679396&view=diff
==============================================================================
--- labs/droids/trunk/src/core/java/org/apache/droids/DefaultCrawler.java (original)
+++ labs/droids/trunk/src/core/java/org/apache/droids/DefaultCrawler.java Thu Jul 24 05:40:38
2008
@@ -38,7 +38,7 @@
  * @version 1.0
  */
 public class DefaultCrawler extends AbstractDroid  {
-  private static final int THREAD_SLEEP = 4000;
+  private static final int THREAD_SLEEP = 500;
   private static final long KEEP_ALIVE = 50000L;
   /**
    * Do the work (whatever it is defined 
@@ -68,7 +68,6 @@
    * @see org.apache.droids.AbstractDroid#startWorkers()
    */
   public long startWorkers() {
-    synchronized (this) {
       long id=0; 
       try {
         Worker worker = getWorker();
@@ -83,7 +82,6 @@
         Core.threadMessage(e.getMessage());
       } 
       return id;
-    }
     
   }
 
@@ -121,12 +119,10 @@
    * @see org.apache.droids.AbstractDroid#getWorker()
    */
   public  Worker getWorker() throws DroidsException {
-    DefaultWorker worker = new DefaultWorker();
-    synchronized (this) {
+    Worker worker = new DefaultWorker();
       worker.setQueue(getQueue());
       worker.setDroid(this);
       return worker;
-    }
     
   }
 

Modified: labs/droids/trunk/src/core/java/org/apache/droids/DefaultWorker.java
URL: http://svn.apache.org/viewvc/labs/droids/trunk/src/core/java/org/apache/droids/DefaultWorker.java?rev=679396&r1=679395&r2=679396&view=diff
==============================================================================
--- labs/droids/trunk/src/core/java/org/apache/droids/DefaultWorker.java (original)
+++ labs/droids/trunk/src/core/java/org/apache/droids/DefaultWorker.java Thu Jul 24 05:40:38
2008
@@ -49,7 +49,7 @@
 
   private int depth;
 
-  public synchronized void run() {
+  public void run() {
     final String userAgent = this.getClass().getCanonicalName();
     Core.threadMessage("Starting " + userAgent);
     try {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message