| java.lang.Object net.sf.ehcache.constructs.concurrent.ConcurrencyUtil
ConcurrencyUtil | final public class ConcurrencyUtil (Code) | | Various bits of black magic garnered from experts on the concurrency-interest@cs.oswego.edu mailing list.
author: Greg Luck version: $Id: ConcurrencyUtil.java 519 2007-07-27 07:11:45Z gregluck $ |
Method Summary | |
public static int | hash(Object object) Returns a hash code for non-null Object x.
This function ensures that hashCodes that differ only by
constant multiples at each bit position have a bounded
number of collisions. | public static int | selectLock(Object key, int numberOfLocks) Selects a lock for a key. |
hash | public static int hash(Object object)(Code) | | Returns a hash code for non-null Object x.
This function ensures that hashCodes that differ only by
constant multiples at each bit position have a bounded
number of collisions. (Doug Lea)
Parameters: object - the object serving as a key the hash code |
selectLock | public static int selectLock(Object key, int numberOfLocks) throws CacheException(Code) | | Selects a lock for a key. The same lock is always used for a given key.
Parameters: key - the selected lock index |
|
|