org.gudy.azureus2.core3.util
Class ConcurrentHasher
java.lang.Object
org.gudy.azureus2.core3.util.ConcurrentHasher
public class ConcurrentHasher
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
singleton
protected static final ConcurrentHasher singleton
processor_num
protected int processor_num
requests
protected final java.util.List<ConcurrentHasherRequest> requests
hashers
protected final java.util.List<SHA1Hasher> hashers
request_sem
protected final AESemaphore request_sem
scheduler_sem
protected final AESemaphore scheduler_sem
requests_mon
protected final AEMonitor requests_mon
ConcurrentHasher
protected ConcurrentHasher()
getSingleton
public static ConcurrentHasher getSingleton()
concurrentHashingAvailable
public static boolean concurrentHashingAvailable()
addRequest
public ConcurrentHasherRequest addRequest(java.nio.ByteBuffer buffer)
- add a synchronous request - on return it will have run (or been cancelled)
addRequest
public ConcurrentHasherRequest addRequest(java.nio.ByteBuffer buffer,
ConcurrentHasherRequestListener listener,
boolean low_priorty)
- Add an asynchronous request if listener supplied, sync otherwise
- Parameters:
buffer
- priority
- listener
- low_priorty
- low priority checks will cause the "friendly hashing" setting to be
taken into account
- Returns:
main
public static void main(java.lang.String[] args)