Use atomic increment for the shared performance counters.
Added new fast routine for inverting 32-bit integers.
Improved sieve performance by eliminating duplicate multipliers.
Fix indentation.
Save memory through manual allocation.
Less calls to GetTimeMicros() when testing the sieve.
Copy the value from boost::thread_specific_ptr to a normal pointer.
Clean up the code a bit.
Initialize the candidate array with zeros to prevent silly candidate counts when a new block interrupts CSieveOfEratosthenes::Weave().
Move CSieveOfEratosthenes::ProcessMultiplier to prime.h so that it gets inlined.
Merge pull request #4 from thared/master

Graceful shutdown of miner threads (David L. Unger)
Fix compiling after applying the shutdown patch.
Attempt to fix the random crash issue while mining. The crash message was:
primecoind: checkqueue.h:167: CCheckQueueControl::CCheckQueueControl(CCheckQueue*) [with T = CScriptCheck]: Assertion `pqueue->nTotal == pqueue->nIdle’ failed.
Experimenting with a fixed round primorial.
Added fast divisibility tests before doing the expensive Fermat's test.
Moved the calculation of the fixed multiplier outside the loop in BitcoinMiner().
Optimize the block header hash loop in BitcoinMiner().
Added a copy of the original code for checking proof of work (as per Sunny King's request).
Drop the 'mining' parameter now that the code paths are separate.
Added fast divisibility testing to EulerLagrangeLifchitzPrimalityTestFast().
Optimize primorial computation.
Get rid of practically all memory allocations inside the primality testing loop.
Other small optimizations.
Speed up GetNextCandidateMultiplier() by skipping entire words.
Restore dynamic round primorial since it seems to be performing pretty well on testnet.
Added a new tuning parameter -sievepercentage.
Added getchainspermin RPC command.
Added 'chainspermin', 'difficulty', 'sievepercentage' and 'sievesize' to the output of the 'getmininginfo' RPC command.