Author: stliu
Date: 2011-01-25 00:15:42 -0500 (Tue, 25 Jan 2011)
New Revision: 20881
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cache/UpdateTimestampsCache.java
Log:
JBPAPP-5814 HHH-5823 HHH-5824 use JUC to improve the Poor multithread performance
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cache/UpdateTimestampsCache.java
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cache/UpdateTimestampsCache.java 2011-01-25
05:14:46 UTC (rev 20880)
+++
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cache/UpdateTimestampsCache.java 2011-01-25
05:15:42 UTC (rev 20881)
@@ -101,12 +101,10 @@
}
}
- public synchronized boolean isUpToDate( Set spaces, Long timestamp ) throws
HibernateException {
+ public boolean isUpToDate( Set spaces, Long timestamp ) throws HibernateException {
readWriteLock.readLock().lock();
try {
- Iterator iter = spaces.iterator();
- while ( iter.hasNext() ) {
- Serializable space = (Serializable) iter.next();
+ for ( Serializable space : (Set<Serializable>) spaces ) {
Long lastUpdate = (Long) region.get( space );
if ( lastUpdate == null ) {
// the last update timestamp was lost from the cache
Show replies by date