[Jpackage-commits] dist/concurrent/devel .cvsignore, 1.1, 1.2 concurrent-1.3.4.build.xml, NONE, 1.1 concurrent-ConcurrentHashMap.patch, NONE, 1.1 concurrent-ConcurrentReaderHashMap.patch, NONE, 1.1 concurrent-PooledExecutor.patch, NONE, 1.1 concurrent-README.txt, NONE, 1.1 concurrent-build.patch, NONE, 1.1 concurrent-component-info.xml, NONE, 1.1 concurrent.spec, NONE, 1.1 sources, 1.1, 1.2

jpackage jpackage at ryu.zarb.org
Fri May 30 21:08:48 CEST 2008


Update of /home/projects/jpackage/cvs/dist/concurrent/devel
In directory ryu.zarb.org:/tmp/cvs-serv14369/devel

Modified Files:
	.cvsignore sources 
Added Files:
	concurrent-1.3.4.build.xml concurrent-ConcurrentHashMap.patch 
	concurrent-ConcurrentReaderHashMap.patch 
	concurrent-PooledExecutor.patch concurrent-README.txt 
	concurrent-build.patch concurrent-component-info.xml 
	concurrent.spec 
Log Message:
Import merged version from Permaine

Index: .cvsignore
===================================================================
RCS file: /home/projects/jpackage/cvs/dist/concurrent/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** .cvsignore	30 May 2008 19:07:31 -0000	1.1
--- .cvsignore	30 May 2008 19:08:46 -0000	1.2
***************
*** 0 ****
--- 1 ----
+ concurrent-1.3.4-src.tar.gz

--- NEW FILE: concurrent-1.3.4.build.xml ---
<project name="concurrent" default="jar" basedir=".">

  <property name="src"      value="src"/>
  <property name="docs"     value="docs"/>
  <property name="build"    value="build"/>
  <property name="j2se.apiurl"
    value="http://java.sun.com/j2se/1.4/docs/api/"/>

  <target name="init">
    <mkdir dir="${build}"/>
  </target>

  <target name="compile" depends="init">
    <javac srcdir="${src}" 
	debug="on"
	optimize="on"
        destdir="${build}"
    />
  </target>

  <target name="jar" depends="compile">
    <jar jarfile="concurrent-${version}.jar" 
         basedir="${build}"
		 />
  </target>

  <target name="javadoc">
    <mkdir dir="${docs}"/>
    <javadoc destdir="${docs}" 
			 packagenames = "EDU.oswego.cs.dl.util.concurrent,EDU.oswego.cs.dl.util.concurrent.misc.*"
			 sourcepath="${src}" 
			 private="off"
			 >
	<link href="${j2se.apiurl}"/>
    </javadoc>
  </target>

  <target name="clean">
    <delete dir="${build}"/>
    <delete>
      <fileset dir="." includes="concurrent-*.jar"/>
    </delete>
  </target>

</project>

--- NEW FILE: concurrent-ConcurrentHashMap.patch ---
Index: src/EDU/oswego/cs/dl/util/concurrent/ConcurrentHashMap.java
===================================================================
--- src/EDU/oswego/cs/dl/util/concurrent/ConcurrentHashMap.java	(revision 4)
+++ src/EDU/oswego/cs/dl/util/concurrent/ConcurrentHashMap.java	(working copy)
@@ -21,6 +21,7 @@
   12jan2001  dl               public release
   17nov2001  dl               Minor tunings
   24oct2003  dl               Segment implements Serializable
+  23jun2004  dl               Avoid bad array sizings in view toArray methods
 */
 
 package EDU.oswego.cs.dl.util.concurrent;
@@ -31,6 +32,7 @@
 import java.util.AbstractCollection;
 import java.util.Collection;
 import java.util.Set;
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
@@ -879,6 +881,32 @@
     public void clear() {
       ConcurrentHashMap.this.clear();
     }
+    public Object[] toArray() {
+      Collection c = new ArrayList();
+      Object o=null;
+      for (Iterator i = iterator(); i.hasNext(); )
+      {
+    	  o = i.next();
+    	  if(o!=null)
+    	  {
+    		  c.add(o);
+    	  } 
+      }
+      return c.toArray();
+    }
+    public Object[] toArray(Object[] a) {
+      Collection c = new ArrayList();
+      Object o=null;
+      for (Iterator i = iterator(); i.hasNext(); )
+      {
+    	  o = i.next();
+    	  if(o!=null)
+    	  {
+    		  c.add(o);
+    	  } 
+      }
+      return c.toArray(a);
+    }
   }
 
   /**
@@ -911,6 +939,32 @@
     public void clear() {
       ConcurrentHashMap.this.clear();
     }
+    public Object[] toArray() {
+      Collection c = new ArrayList();
+      Object o=null;
+      for (Iterator i = iterator(); i.hasNext(); )
+      {
+    	  o = i.next();
+    	  if(o!=null)
+    	  {
+    		  c.add(o);
+    	  } 
+      }
+      return c.toArray();
+    }
+    public Object[] toArray(Object[] a) {
+      Collection c = new ArrayList();
+      Object o=null;
+      for (Iterator i = iterator(); i.hasNext(); )
+      {
+    	  o = i.next();
+    	  if(o!=null)
+    	  {
+    		  c.add(o);
+    	  } 
+      }
+      return c.toArray(a);
+    }
   }
 
   /**
@@ -954,6 +1008,32 @@
     public void clear() {
       ConcurrentHashMap.this.clear();
     }
+    public Object[] toArray() {
+      Collection c = new ArrayList();
+      Object o=null;
+      for (Iterator i = iterator(); i.hasNext(); )
+      {
+    	  o = i.next();
+    	  if(o!=null)
+    	  {
+    		  c.add(o);
+    	  } 
+      }
+      return c.toArray();
+    }
+    public Object[] toArray(Object[] a) {
+      Collection c = new ArrayList();
+      Object o=null;
+      for (Iterator i = iterator(); i.hasNext(); )
+      {
+    	  o = i.next();
+    	  if(o!=null)
+    	  {
+    		  c.add(o);
+    	  } 
+      }
+      return c.toArray(a);
+    }
   }
 
   /**

--- NEW FILE: concurrent-component-info.xml ---
<project name="oswego-concurrent-component-info">
   <!-- ============================================================ -->
   <!-- Oswego Concurrent Library                                    -->
   <!-- ============================================================ -->
   <component id="oswego-concurrent"
              licenseType="oswego"
              version="@VERSION@"
              projectHome="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"
              description="Oswego util.concurrent package"
              scm=":ext:cvs.devel.redhat.com:/cvs/dist/concurrent"
              tag="@TAG@">
      <!-- Built using JDK 1.4 -->

      <artifact id="concurrent.jar"/>
      <artifact id="concurrent-src.zip"/>
      <export>
         <include input="concurrent.jar"/>
      </export>
   </component>
</project>

--- NEW FILE: concurrent.spec ---
# Copyright (c) 2000-2007, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the JPackage Project nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

# If you want repolib package to be built,
# issue the following: 'rpmbuild --with repolib'

%define _with_repolib 1

%define with_repolib %{?_with_repolib:1}%{!?_with_repolib:0}
%define without_repolib %{!?_with_repolib:1}%{?_with_repolib:0}

%define repodir %{_javadir}/repository.jboss.com/oswego-concurrent/%{version}.%{reltag}-brew
%define repodirlib %{repodir}/lib
%define repodirsrc %{repodir}/src

%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}

%define section free

%define reltag  patch01

Name:           concurrent
Version:        1.3.4
Release:        8%{?dist}
Epoch:          0
Summary:        Utility classes for concurrent Java programming
License:        Public Domain
Source0:        http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/current/concurrent-1.3.4-src.tar.gz
# Source1 not used, kept for reference
Source1:        %{name}-%{version}.build.xml

Source2:	concurrent-component-info.xml
Source3:	concurrent-README.txt
Patch0:		concurrent-build.patch
# This effectively fixes the oswego library.
# Several defects were found, including an unthreadsafe call to toArray()
Patch1:		concurrent-ConcurrentHashMap.patch
Patch2:		concurrent-ConcurrentReaderHashMap.patch
Patch3:		concurrent-PooledExecutor.patch
URL:            http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/
Group:          Development/Libraries/Java
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%if ! %{gcj_support}
BuildArch:      noarch
%endif
BuildRequires:  jpackage-utils >= 0:1.6
BuildRequires:  java-devel
BuildRequires:  ant
BuildRequires:  /bin/bash
BuildRequires:  zip

%if %{gcj_support}
BuildRequires:    gnu-crypto
BuildRequires:       java-gcj-compat-devel
Requires(post):      java-gcj-compat
Requires(postun):    java-gcj-compat
%endif

%description 
This package provides standardized, efficient versions of utility classes
commonly encountered in concurrent Java programming. This code consists of
implementations of ideas that have been around for ages, and is merely intended
to save you the trouble of coding them. Discussions of the rationale and
applications of several of these classes can be found in the second edition of
Concurrent Programming in Java.

%if %{with_repolib}
%package	 repolib
Summary:	 Artifacts to be uploaded to a repository library
Group:	Development/Libraries/Java

%description	 repolib
Artifacts to be uploaded to a repository library.
This package is not meant to be installed but so its contents
can be extracted through rpm2cpio
%endif

%package javadoc
Summary:        Javadoc for %{name}
Group:          Development/Documentation
Requires(post): /bin/rm /bin/ln
Requires(postun): /bin/rm

%description javadoc
Javadoc for %{name}.

%prep
%setup -c -q

mkdir -p src/EDU/oswego/cs/dl/util
mv concurrent src/EDU/oswego/cs/dl/util

# Build with debug on
pushd src/EDU/oswego/cs/dl/util/concurrent
%patch0
popd

%patch1
%patch2
%patch3

# Pack sources in a proper way for loading into Eclipse
# Note that the sources for Eclipse contain the patches already
pushd src
find . -name "*.java" -print | zip ../concurrent-src.zip -@
popd
zip -d concurrent-src.zip EDU/oswego/cs/dl/util/concurrent/taskDemo/\*

sed -i 's/@VERSION@/%{version}.%{reltag}-brew/g' %{SOURCE2}
tag=`echo %{name}-%{version}-%{release} | sed 's|\.|_|g'`
sed -i "s/@TAG@/$tag/g" %{SOURCE2}

%build
pushd src/EDU/oswego/cs/dl/util/concurrent

ant \
  -Dversion=%{version} \
  -Dj2se.apiurl=%{_javadocdir}/java \
  dist javadoc

popd

%install
rm -fr $RPM_BUILD_ROOT
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
pwd
ls
install -m 644 src/EDU/oswego/cs/dl/util/concurrent/lib/%{name}.jar \
               $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr src/EDU/oswego/cs/dl/util/concurrent/docs/* \
       $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink

%if %{with_repolib}
	install -d -m 755 $RPM_BUILD_ROOT%{repodir}
	install -d -m 755 $RPM_BUILD_ROOT%{repodirlib}
	install -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{repodir}/component-info.xml
	install -d -m 755 $RPM_BUILD_ROOT%{repodirsrc}
	install -m 755 %{SOURCE0} $RPM_BUILD_ROOT%{repodirsrc}
	install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{repodirsrc}
	install -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{repodirsrc}/README.txt
	install -m 755 %{PATCH0} $RPM_BUILD_ROOT%{repodirsrc}
	install -m 755 %{PATCH1} $RPM_BUILD_ROOT%{repodirsrc}
	install -m 755 %{PATCH2} $RPM_BUILD_ROOT%{repodirsrc}
	install -m 755 %{PATCH3} $RPM_BUILD_ROOT%{repodirsrc}
	cp $RPM_BUILD_ROOT%{_javadir}/%{name}.jar $RPM_BUILD_ROOT%{repodirlib}
	cp concurrent-src.zip $RPM_BUILD_ROOT%{repodirlib}
%endif

%if %{gcj_support}
export CLASSPATH=$(build-classpath gnu-crypto)
%{_bindir}/aot-compile-rpm
%endif

%clean
rm -rf $RPM_BUILD_ROOT


%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}

%postun javadoc
if [ "$1" = "0" ]; then
    rm -f %{_javadocdir}/%{name}
fi

%if %{gcj_support}
%post
if [ -x %{_bindir}/rebuild-gcj-db ]
then
  %{_bindir}/rebuild-gcj-db
fi
%endif

%if %{gcj_support}
%postun
if [ -x %{_bindir}/rebuild-gcj-db ]
then
  %{_bindir}/rebuild-gcj-db
fi
%endif

%files
%defattr(0644,root,root,0755)
%{_javadir}/*.jar

%if %{gcj_support}
%attr(-,root,root) %{_libdir}/gcj/%{name}/concurrent-1.3.4.jar.*
%endif

%files javadoc
%defattr(0644,root,root,0755)
%doc %{_javadocdir}/%{name}-%{version}
%ghost %doc %{_javadocdir}/%{name}


%if %{with_repolib}
%files repolib
%defattr(0644,root,root,0755)
%{repodir}
%endif

%changelog
* Wed May 28 2008 Permaine Cheung <pcheung at redhat.com> - 0:1.3.4-8
- First JPP 5 build

* Wed Jan 23 2008 Fernando Nasser <fnasser at redhat.com> - 0:1.3.4-7jpp.ep1.6
- The source aip for Eclipse must have the patches applied

* Wed Jan 23 2008 Fernando Nasser <fnasser at redhat.com> - 0:1.3.4-7jpp.ep1.5
- Remove src from source tar ball path

* Wed Jan 23 2008 Fernando Nasser <fnasser at redhat.com> - 0:1.3.4-7jpp.ep1.4
- Actually apply patch

* Wed Jan 23 2008 Fernando Nasser <fnasser at redhat.com> - 0:1.3.4-7jpp.ep1.3
- Add missing PooledExecutor patch

* Wed Jan 23 2008 Fernando Nasser <fnasser at redhat.com> - 0:1.3.4-7jpp.ep1.2
- Add source zip file
- Strip prefix from README file name

* Mon Jan 21 2008 Fernando Nasser <fnasser at redhat.com> - 0:1.3.4-7jpp.ep1.1
- Add patches for JBAS-4698

* Mon May 21 2007 Ralph Apel <r.apel at r-apel.de> - 0:1.3.4-7jpp
- Make Vendor, Distribution based on macro
- Fix aot build
- Rebuild using java-1.4.2

* Fri Mar 23 2007 Fernando Nasser <fnasser at redhat.com> - 0:1.3.4-6jpp.ep1.2
- Rebuild to get the proper tag in component-info.xml

* Fri Mar 23 2007 Fernando Nasser <fnasser at redhat.com> - 0:1.3.4-6jpp.ep1.1
- Merge with upstream for fixes in the build

* Fri Mar 23 2007 Fernando Nasser <fnasser at redhat.com> - 0:1.3.4-6jpp
- Use provided build.xml

* Tue Mar 13 2007 Vivek Lakshmanan <vivekl at redhat.com> 0:1.3.4-1jpp.ep1.2
- Fix repolib location

* Tue Mar 13 2007 Fernando Nasser <fnasser at redhat.com> 0:1.3.4-1jpp.ep1.1
- New repolib location

* Mon Feb 19 2007 Vivek Lakshmanan <vivekl at redhat.com> 0:1.3.4-1jpp.el4ep1.2
- Add -brew suffix

* Fri Feb 16 2007 Vivek Lakshmanan <vivekl at redhat.com> 0:1.3.4-1jpp.el4ep1.1
- Add repolib support
- Use build.xml from upstream to produce a standard jar

* Fri Jan 26 2007 Permaine Cheung <pcheung at redhat.com> - 0:1.3.4-5jpp
- rpmlint cleanup

* Thu Aug 03 2006 Matt Wringe <mwringe at redhat.com> - 0:1.3.4-4jpp
- Add missing requires for javadoc task
- Add missing postun for javadoc task

* Thu Jul 20 2006 Matt Wringe <mwringe at redhat.com> - 0:1.3.4-3jpp
- Added conditional native compiling

* Thu Apr 27 2006 Fernando Nasser <fnasser at redhat.com> - 0:1.3.4-2jpp
- First JPP 1.7 build

* Tue Jul 26 2005 Fernando Nasser <fnasser at redhat.com> 0:1.3.4-1jpp_1rh
- Merge with upstream

* Thu Dec 23 2004 Sebastiano Vigna <vigna at acm.org> 0:1.3.4-1jpp
- New release.

* Tue Nov 23 2004 Fernando Nasser <fnasser at redhat.com> 0:1.3.2-2jpp_2rh
- Rebuild

* Fri Aug 20 2004 Ralph Apel <r.apel at r-apel.de> 0:1.3.2-3jpp
- Build with ant-1.6.2

* Thu Mar  4 2004 Frank Ch. Eigler <fche at redhat.com> 0:4.1.29-2jpp_1rh
- RH vacuuming

* Wed Nov 19 2003 Sebastiano Vigna <vigna at acm.org> 0:1.3.2-2jpp
- Package name restored to EDU.

* Wed Nov 19 2003 Sebastiano Vigna <vigna at acm.org> 0:1.3.2-1jpp
- First JPackage version

--- NEW FILE: concurrent-README.txt ---
This is the latest version of oswego concurrent
compiled with jdk1.4

# Merge JBAS-4698
# This effectively fixes the oswego library.
# Several defects were found, including an unthreadsafe call to toArray()
Patch1:         concurrent-ConcurrentHashMap.patch
Patch2:         concurrent-ConcurrentReaderHashMap.patch

The patches enable debug for the generated code
and apply the unreleased fixes to 
ConcurrentHashMap and PooledExecutor mentioned here:
http://g.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html

Index: sources
===================================================================
RCS file: /home/projects/jpackage/cvs/dist/concurrent/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** sources	30 May 2008 19:07:32 -0000	1.1
--- sources	30 May 2008 19:08:46 -0000	1.2
***************
*** 0 ****
--- 1 ----
+ 6a7898a403c3c400f271c6e9285ce9a2  concurrent-1.3.4-src.tar.gz

--- NEW FILE: concurrent-ConcurrentReaderHashMap.patch ---
Index: src/EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap.java
===================================================================
--- src/EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap.java	(revision 3)
+++ src/EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap.java	(working copy)
@@ -28,6 +28,7 @@
 
 package EDU.oswego.cs.dl.util.concurrent;
 
+import java.util.ArrayList;
 import java.util.Map;
 import java.util.AbstractMap;
 import java.util.AbstractSet;
@@ -901,6 +902,34 @@
     public void clear() {
       ConcurrentReaderHashMap.this.clear();
     }
+    
+    public Object[] toArray() {
+        Collection c = new ArrayList();
+        Object o=null;
+        for (Iterator i = iterator(); i.hasNext(); )
+        {
+      	  o = i.next();
+      	  if(o!=null)
+      	  {
+      		  c.add(o);
+      	  } 
+        }
+        return c.toArray();
+      }
+    
+    public Object[] toArray(Object[] a) {
+        Collection c = new ArrayList();
+        Object o=null;
+        for (Iterator i = iterator(); i.hasNext(); )
+        {
+      	  o = i.next();
+      	  if(o!=null)
+      	  {
+      		  c.add(o);
+      	  } 
+        }
+        return c.toArray(a);
+      }
   }
 
   /**
@@ -933,6 +962,35 @@
     public void clear() {
       ConcurrentReaderHashMap.this.clear();
     }
+    
+    public Object[] toArray() {
+        Collection c = new ArrayList();
+        Object o=null;
+        for (Iterator i = iterator(); i.hasNext(); )
+        {
+      	  o = i.next();
+      	  if(o!=null)
+      	  {
+      		  c.add(o);
+      	  } 
+        }
+        return c.toArray();
+      }
+    
+    public Object[] toArray(Object[] a) {
+        Collection c = new ArrayList();
+        Object o=null;
+        for (Iterator i = iterator(); i.hasNext(); )
+        {
+      	  o = i.next();
+      	  if(o!=null)
+      	  {
+      		  c.add(o);
+      	  } 
+        }
+        return c.toArray(a);
+      }
+    
   }
 
   /**
@@ -975,6 +1033,34 @@
     public void clear() {
       ConcurrentReaderHashMap.this.clear();
     }
+    
+    public Object[] toArray() {
+        Collection c = new ArrayList();
+        Object o=null;
+        for (Iterator i = iterator(); i.hasNext(); )
+        {
+      	  o = i.next();
+      	  if(o!=null)
+      	  {
+      		  c.add(o);
+      	  } 
+        }
+        return c.toArray();
+      }
+    
+    public Object[] toArray(Object[] a) {
+        Collection c = new ArrayList();
+        Object o=null;
+        for (Iterator i = iterator(); i.hasNext(); )
+        {
+      	  o = i.next();
+      	  if(o!=null)
+      	  {
+      		  c.add(o);
+      	  } 
+        }
+        return c.toArray(a);
+      }
   }
 
   /**

--- NEW FILE: concurrent-build.patch ---
*** build.xml.orig	2007-03-23 13:38:19.000000000 -0400
--- build.xml	2007-03-23 13:39:30.000000000 -0400
***************
*** 42,48 ****
  </target>
  
  <target name="compile" depends="setup.packages">
!         <javac srcdir="src" destdir="build" optimize="true"/>
  </target>
  
  <target name="dist" depends="compile">
--- 42,48 ----
  </target>
  
  <target name="compile" depends="setup.packages">
!         <javac srcdir="src" destdir="build" debug="on" optimize="true"/>
  </target>
  
  <target name="dist" depends="compile">

--- NEW FILE: concurrent-PooledExecutor.patch ---
--- src/EDU/oswego/cs/dl/util/concurrent/PooledExecutor.java	2007-09-11 14:32:37.000000000 +0200
+++ /home/ejort/temp/PooledExecutor.java	2005-07-15 20:47:08.000000000 +0200
@@ -27,10 +27,11 @@
                               Simplify locking scheme
   25jan2001  dl               {get,set}BlockedExecutionHandler now public
   17may2002  dl               null out task var in worker run to enable GC.
   30aug2003  dl               check for new tasks when timing out
   18feb2004  dl               replace dead thread if no others left
+  23jun2004  dl               fix shutdownAfterProcessingCurrentlyQueuedTasks
 */
 
 package EDU.oswego.cs.dl.util.concurrent;
 import java.util.*;
 
@@ -589,15 +590,27 @@
    * Terminate threads after processing all elements currently in
    * queue. Any tasks entered after this point will be handled by the
    * given BlockedExecutionHandler.  A shut down pool cannot be
    * restarted.
    **/
-  public synchronized void shutdownAfterProcessingCurrentlyQueuedTasks(BlockedExecutionHandler handler) {
-    setBlockedExecutionHandler(handler);
-    shutdown_ = true;
-    if (poolSize_ == 0) // disable new thread construction when idle
-      minimumPoolSize_ = maximumPoolSize_ = 0;
+  public void shutdownAfterProcessingCurrentlyQueuedTasks(BlockedExecutionHandler handler) {
+    synchronized(this) {
+      setBlockedExecutionHandler(handler);
+      shutdown_ = true;
+      if (poolSize_ == 0) // disable new thread construction when idle
+        minimumPoolSize_ = maximumPoolSize_ = 0;
+    }
+    // Try to add a final task to interrupt remaining threads waiting
+    // on handoff that will never otherwise get new tasks. If the
+    // offer fails, no threads such could be waiting
+    try { 
+      Runnable r = new Runnable() { public void run() { interruptAll(); }};
+      handOff_.offer(r, 0);
+    }
+    catch(InterruptedException ie) { 
+      Thread.currentThread().interrupt(); 
+    }
   }
 
   /** 
    * Return true if a shutDown method has succeeded in terminating all
    * threads.




More information about the JPackage-commits mailing list