diff options
author | Kay Ramme <kr@openoffice.org> | 2000-10-19 14:44:57 +0000 |
---|---|---|
committer | Kay Ramme <kr@openoffice.org> | 2000-10-19 14:44:57 +0000 |
commit | f640281c0c527b47d322080bc11a92b270c31edc (patch) | |
tree | b728cd7d8cd9737845ab8668393f43f6341a43ec /jurt | |
parent | 1d0f60c1647273fdab79c3025cb282f2a20655c4 (diff) |
moved thread add counting from JobQueue to JavaThreadPool
Diffstat (limited to 'jurt')
-rw-r--r-- | jurt/com/sun/star/lib/uno/environments/remote/JavaThreadPool.java | 11 | ||||
-rw-r--r-- | jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java | 9 |
2 files changed, 11 insertions, 9 deletions
diff --git a/jurt/com/sun/star/lib/uno/environments/remote/JavaThreadPool.java b/jurt/com/sun/star/lib/uno/environments/remote/JavaThreadPool.java index f24d5b663b7e..c61acf37c0b7 100644 --- a/jurt/com/sun/star/lib/uno/environments/remote/JavaThreadPool.java +++ b/jurt/com/sun/star/lib/uno/environments/remote/JavaThreadPool.java @@ -2,9 +2,9 @@ * * $RCSfile: JavaThreadPool.java,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 15:27:52 $ + * last change: $Author: kr $ $Date: 2000-10-19 15:44:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,7 +71,7 @@ import com.sun.star.uno.UnoRuntime; /** * This class implements a java thread pool. * <p> - * @version $Revision: 1.1.1.1 $ $ $Date: 2000-09-18 15:27:52 $ + * @version $Revision: 1.2 $ $ $Date: 2000-10-19 15:44:57 $ * @author Kay Ramme * @see com.sun.star.uno.UnoRuntime * @see com.sun.star.lib.uno.environments.remote.ThreadPool @@ -162,6 +162,8 @@ public class JavaThreadPool implements IThreadPool { } } } + else + ++ jobQueue._add_count; } /** @@ -204,6 +206,7 @@ public class JavaThreadPool implements IThreadPool { if(DEBUG) System.err.println("##### ThreadPool.removeThread:" + threadId); JobQueue jobQueue = (JobQueue)_jobQueues.get(threadId); + if(jobQueue != null && jobQueue._add_count <= 0) { synchronized(_jobQueues) { if(jobQueue._add_count <= 0) { @@ -211,6 +214,8 @@ public class JavaThreadPool implements IThreadPool { _disposeIds.remove(threadId); _jobQueues.notifyAll(); } + else + -- jobQueue._add_count; } } } diff --git a/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java b/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java index ec4ec39ba857..6bbf56d07092 100644 --- a/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java +++ b/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java @@ -2,9 +2,9 @@ * * $RCSfile: JobQueue.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: kr $ $Date: 2000-09-28 11:32:50 $ + * last change: $Author: kr $ $Date: 2000-10-19 15:44:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,7 +76,7 @@ import com.sun.star.uno.UnoRuntime; * (put by <code>putjob</code>) into the async queue, which is only * known by the sync queue. * <p> - * @version $Revision: 1.2 $ $ $Date: 2000-09-28 11:32:50 $ + * @version $Revision: 1.3 $ $ $Date: 2000-10-19 15:44:57 $ * @author Kay Ramme * @see com.sun.star.lib.uno.environments.remote.ThreadPool * @see com.sun.star.lib.uno.environments.remote.Job @@ -401,8 +401,6 @@ public class JobQueue { MutableInt disposeId_count = addDisposeId(disposeId); - ++ _add_count; // how many times have entered enter? - Object result = null; Thread hold_worker_thread = _worker_thread; @@ -441,7 +439,6 @@ public class JobQueue { synchronized(this) { if(job != null || (quit && _head == null)) { - -- _add_count; _worker_thread = hold_worker_thread; _createThread_now = true; |