You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/07/22 01:31:01 UTC
[lucene-solr] branch reference_impl updated: @278 More improve the
thread management life cycle.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/reference_impl by this push:
new 7089947 @278 More improve the thread management life cycle.
7089947 is described below
commit 70899472eb3db9eda5c1cdf44daaa79c0a9153ee
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Tue Jul 21 20:30:44 2020 -0500
@278 More improve the thread management life cycle.
---
solr/solrj/src/java/org/apache/solr/common/ParWorkExecutor.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/solr/solrj/src/java/org/apache/solr/common/ParWorkExecutor.java b/solr/solrj/src/java/org/apache/solr/common/ParWorkExecutor.java
index d618cf8..42000ae 100644
--- a/solr/solrj/src/java/org/apache/solr/common/ParWorkExecutor.java
+++ b/solr/solrj/src/java/org/apache/solr/common/ParWorkExecutor.java
@@ -38,7 +38,12 @@ public class ParWorkExecutor extends ThreadPoolExecutor {
@Override
public Thread newThread(Runnable r) {
- Thread t = new Thread(group, r, name + threadNumber.getAndIncrement(), 0);
+ Thread t = new Thread(group, r, name + threadNumber.getAndIncrement(), 0) {
+ public void run() {
+ super.run();
+ ParWork.close(ParWork.getExecutor());
+ }
+ };
t.setDaemon(true);
// t.setPriority(priority);
return t;