moved to Queue rather than Deque
import java.security.SecureRandom;
import java.security.SecureRandomSpi;
import java.security.Security;
-import java.util.concurrent.ConcurrentLinkedDeque;
+import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.bouncycastle.crypto.CryptoServicesRegistrar;
import org.bouncycastle.crypto.digests.SHA512Digest;
import org.bouncycastle.crypto.macs.HMac;
import org.bouncycastle.crypto.prng.EntropySource;
/**
* <b>DRBG Configuration</b><br/>
- * <p>org.bouncycastle.drbg.gather_pause_secs - is to stop the entropy collection thread from grabbing all
+ * <p>
+ * org.bouncycastle.drbg.gather_pause_secs - is to stop the entropy collection thread from grabbing all
* available entropy on the system. The original motivation for the hybrid infrastructure was virtual machines
* sometimes produce very few bits of entropy a second, the original approach (which "worked" at least for BC) was
* to just read on the second thread and allow things to progress around it, but it did tend to hog the system
* enough to allow everyone to work together, but small enough to ensure the provider's DRBG is being regularly
* reseeded.
* </p>
- * <p>org.bouncycastle.drbg.entropysource - is the class name for an implementation of EntropySourceProvider.
+ * <p>
+ * org.bouncycastle.drbg.entropysource - is the class name for an implementation of EntropySourceProvider.
* For example, one could be provided which just reads directly from /dev/random and the extra infrastructure used here
- * could be avoided.</p>
+ * could be avoided.
+ * </p>
*/
public class DRBG
{
@@ -301,7 +303,7 @@ public EntropySourceProvider run()
private static class EntropyDaemon
implements Runnable
{
- private final ConcurrentLinkedDeque<Runnable> tasks = new ConcurrentLinkedDeque<Runnable>();
+ private final ConcurrentLinkedQueue<Runnable> tasks = new ConcurrentLinkedQueue<Runnable>();
void addTask(Runnable task)
{
@@ -313,7 +315,7 @@ public void run()
{
while (!Thread.currentThread().isInterrupted())
{
- Runnable task = tasks.pollFirst();
+ Runnable task = tasks.poll();
if (task != null)
{
