ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166e/ConcurrentHashMapV8.java
(Generate patch)

Comparing jsr166/src/jsr166e/ConcurrentHashMapV8.java (file contents):
Revision 1.52 by dl, Mon Aug 13 15:52:33 2012 UTC vs.
Revision 1.53 by jsr166, Mon Aug 13 18:13:30 2012 UTC

# Line 3636 | Line 3636 | public class ConcurrentHashMapV8<K, V>
3636           *
3637           * @param action the action
3638           */
3639 <        public void forEach(BiAction<K,V> action) {
3639 >        public void forEach(BiAction<K,V> action) {
3640              fjp.invoke(ForkJoinTasks.forEach
3641                         (ConcurrentHashMapV8.this, action));
3642          }
# Line 3650 | Line 3650 | public class ConcurrentHashMapV8<K, V>
3650           * which case the action is not applied).
3651           * @param action the action
3652           */
3653 <        public <U> void forEach(BiFun<? super K, ? super V, ? extends U> transformer,
3653 >        public <U> void forEach(BiFun<? super K, ? super V, ? extends U> transformer,
3654                                  Action<U> action) {
3655              fjp.invoke(ForkJoinTasks.forEach
3656                         (ConcurrentHashMapV8.this, transformer, action));
# Line 3754 | Line 3754 | public class ConcurrentHashMapV8<K, V>
3754           *
3755           * @param action the action
3756           */
3757 <        public void forEachKey(Action<K> action) {
3757 >        public void forEachKey(Action<K> action) {
3758              fjp.invoke(ForkJoinTasks.forEachKey
3759                         (ConcurrentHashMapV8.this, action));
3760          }
# Line 3768 | Line 3768 | public class ConcurrentHashMapV8<K, V>
3768           * which case the action is not applied).
3769           * @param action the action
3770           */
3771 <        public <U> void forEachKey(Fun<? super K, ? extends U> transformer,
3771 >        public <U> void forEachKey(Fun<? super K, ? extends U> transformer,
3772                                     Action<U> action) {
3773              fjp.invoke(ForkJoinTasks.forEachKey
3774                         (ConcurrentHashMapV8.this, transformer, action));
# Line 3884 | Line 3884 | public class ConcurrentHashMapV8<K, V>
3884           *
3885           * @param action the action
3886           */
3887 <        public void forEachValue(Action<V> action) {
3887 >        public void forEachValue(Action<V> action) {
3888              fjp.invoke(ForkJoinTasks.forEachValue
3889                         (ConcurrentHashMapV8.this, action));
3890          }
# Line 3897 | Line 3897 | public class ConcurrentHashMapV8<K, V>
3897           * for an element, or null of there is no transformation (in
3898           * which case the action is not applied).
3899           */
3900 <        public <U> void forEachValue(Fun<? super V, ? extends U> transformer,
3900 >        public <U> void forEachValue(Fun<? super V, ? extends U> transformer,
3901                                       Action<U> action) {
3902              fjp.invoke(ForkJoinTasks.forEachValue
3903                         (ConcurrentHashMapV8.this, transformer, action));
# Line 4013 | Line 4013 | public class ConcurrentHashMapV8<K, V>
4013           *
4014           * @param action the action
4015           */
4016 <        public void forEachEntry(Action<Map.Entry<K,V>> action) {
4016 >        public void forEachEntry(Action<Map.Entry<K,V>> action) {
4017              fjp.invoke(ForkJoinTasks.forEachEntry
4018                         (ConcurrentHashMapV8.this, action));
4019          }
# Line 4027 | Line 4027 | public class ConcurrentHashMapV8<K, V>
4027           * which case the action is not applied).
4028           * @param action the action
4029           */
4030 <        public <U> void forEachEntry(Fun<Map.Entry<K,V>, ? extends U> transformer,
4030 >        public <U> void forEachEntry(Fun<Map.Entry<K,V>, ? extends U> transformer,
4031                                       Action<U> action) {
4032              fjp.invoke(ForkJoinTasks.forEachEntry
4033                         (ConcurrentHashMapV8.this, transformer, action));
# Line 4159 | Line 4159 | public class ConcurrentHashMapV8<K, V>
4159           * @param action the action
4160           * @return the task
4161           */
4162 <        public static <K,V> ForkJoinTask<Void> forEach
4162 >        public static <K,V> ForkJoinTask<Void> forEach
4163              (ConcurrentHashMapV8<K,V> map,
4164               BiAction<K,V> action) {
4165              if (action == null) throw new NullPointerException();
# Line 4177 | Line 4177 | public class ConcurrentHashMapV8<K, V>
4177           * @param action the action
4178           * @return the task
4179           */
4180 <        public static <K,V,U> ForkJoinTask<Void> forEach
4180 >        public static <K,V,U> ForkJoinTask<Void> forEach
4181              (ConcurrentHashMapV8<K,V> map,
4182               BiFun<? super K, ? super V, ? extends U> transformer,
4183               Action<U> action) {
# Line 4310 | Line 4310 | public class ConcurrentHashMapV8<K, V>
4310           * @param action the action
4311           * @return the task
4312           */
4313 <        public static <K,V> ForkJoinTask<Void> forEachKey
4313 >        public static <K,V> ForkJoinTask<Void> forEachKey
4314              (ConcurrentHashMapV8<K,V> map,
4315               Action<K> action) {
4316              if (action == null) throw new NullPointerException();
# Line 4328 | Line 4328 | public class ConcurrentHashMapV8<K, V>
4328           * @param action the action
4329           * @return the task
4330           */
4331 <        public static <K,V,U> ForkJoinTask<Void> forEachKey
4331 >        public static <K,V,U> ForkJoinTask<Void> forEachKey
4332              (ConcurrentHashMapV8<K,V> map,
4333               Fun<? super K, ? extends U> transformer,
4334               Action<U> action) {
# Line 4477 | Line 4477 | public class ConcurrentHashMapV8<K, V>
4477           * @param map the map
4478           * @param action the action
4479           */
4480 <        public static <K,V> ForkJoinTask<Void> forEachValue
4480 >        public static <K,V> ForkJoinTask<Void> forEachValue
4481              (ConcurrentHashMapV8<K,V> map,
4482               Action<V> action) {
4483              if (action == null) throw new NullPointerException();
# Line 4494 | Line 4494 | public class ConcurrentHashMapV8<K, V>
4494           * which case the action is not applied).
4495           * @param action the action
4496           */
4497 <        public static <K,V,U> ForkJoinTask<Void> forEachValue
4497 >        public static <K,V,U> ForkJoinTask<Void> forEachValue
4498              (ConcurrentHashMapV8<K,V> map,
4499               Fun<? super V, ? extends U> transformer,
4500               Action<U> action) {
# Line 4645 | Line 4645 | public class ConcurrentHashMapV8<K, V>
4645           * @param map the map
4646           * @param action the action
4647           */
4648 <        public static <K,V> ForkJoinTask<Void> forEachEntry
4648 >        public static <K,V> ForkJoinTask<Void> forEachEntry
4649              (ConcurrentHashMapV8<K,V> map,
4650               Action<Map.Entry<K,V>> action) {
4651              if (action == null) throw new NullPointerException();
# Line 4662 | Line 4662 | public class ConcurrentHashMapV8<K, V>
4662           * which case the action is not applied).
4663           * @param action the action
4664           */
4665 <        public static <K,V,U> ForkJoinTask<Void> forEachEntry
4665 >        public static <K,V,U> ForkJoinTask<Void> forEachEntry
4666              (ConcurrentHashMapV8<K,V> map,
4667               Fun<Map.Entry<K,V>, ? extends U> transformer,
4668               Action<U> action) {
# Line 4877 | Line 4877 | public class ConcurrentHashMapV8<K, V>
4877              try {
4878                  compute();
4879              }
4880 <            catch(Throwable ex) {
4880 >            catch (Throwable ex) {
4881                  tryAbortComputation(ex);
4882              }
4883              return false;
# Line 4904 | Line 4904 | public class ConcurrentHashMapV8<K, V>
4904              if (b < 0) {
4905                  long n = map.counter.sum();
4906                  int sp = getPool().getParallelism() << 3; // slack of 8
4907 <                b = batch = (n <= 0L)? 0 : (n < (long)sp) ? (int)n : sp;
4907 >                b = batch = (n <= 0L) ? 0 : (n < (long)sp) ? (int)n : sp;
4908              }
4909              return b;
4910          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines