Prevent race conditions when getting elements for the first time or

after flushing the cache
This commit is contained in:
Ruben S. Montero committed 2018-09-06 11:10:45 +02:00
1 parent 10f014db10
commit b99066f4e1
1 file changed
+6 -12
+6 -12
View File
@@ -41,18 +41,12 @@ void PoolSQLCache::lock_line(int oid)
{
cl = new CacheLine(0);
cl->active++;
cache.insert(make_pair(oid, cl));
unlock();
cl->lock();
return;
}
cl = it->second;
else
{
cl = it->second;
}
cl->active++;
@@ -65,9 +59,9 @@ void PoolSQLCache::lock_line(int oid)
cl->object->lock();
delete cl->object;
}
cl->object = 0;
cl->object = 0;
}
return;
}