Factor upTime() out of KeyCache, fix warnings

This commit is contained in:
Vinnie Falco
2013-05-25 12:08:17 -07:00
parent 55c39b7131
commit e227637e34
15 changed files with 57 additions and 48 deletions

View File

@@ -9,9 +9,21 @@
#include "uint256.h"
#include "ScopedLock.h"
#include "TaggedCache.h"
#include "KeyCache.h"
#include "InstanceCounter.h"
// VFALCO: TODO, Move this to someplace sensible!!
// Adapter to furnish uptime information to KeyCache via UptimeTimer singleton
struct KeyCacheUptimeTimer
{
inline static int getElapsedSeconds ()
{
return UptimeTimer::getInstance().getElapsedSeconds ();
}
};
DEFINE_INSTANCE(HashedObject);
class Job;
@@ -51,7 +63,7 @@ class HashedObjectStore
{
protected:
TaggedCache<uint256, HashedObject> mCache;
KeyCache<uint256> mNegativeCache;
KeyCache <uint256, KeyCacheUptimeTimer> mNegativeCache;
boost::mutex mWriteMutex;
boost::condition_variable mWriteCondition;