MCPcopy Create free account
hub / github.com/chen3feng/toft / ReadThread

Function ReadThread

container/lru_cache_test.cpp:108–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108static void ReadThread(LruCache<int, int> *cache) {
109 int64_t now = RealtimeClock.MicroSeconds();
110 int value;
111 while (RealtimeClock.MicroSeconds() - now < 500) {
112 for (int i = 2; i < 1000; ++i) {
113 bool r = cache->Get(i, &value);
114 if (r) {
115 ASSERT_EQ(0, value % i);
116 }
117 }
118 }
119}
120
121TEST(ThreadSafeLruCacheTest, MultiThread) {
122 LruCache<int, int> cache(900);

Callers

nothing calls this directly

Calls 2

MicroSecondsMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected