You are not logged in.
Pages: 1
Hi AB
function TSQLRestCache.CachedEntries: cardinal;
var i,j: integer;
begin
result := 0;
if self<>nil then
for i := 0 to high(fCache) do
with fCache[i] do
if CacheEnable then
for j := 0 to Count-1 do
if Values[j].TimeStamp64<>0 then
inc(result);
end;
given that the cycle works with Values [] would be better to put it under CriticalSection:
function TSQLRestCache.CachedEntries: cardinal;
var i,j: integer;
begin
EnterCriticalSection(Mutex);
try
result := 0;
if self<>nil then
for i := 0 to high(fCache) do
with fCache[i] do
if CacheEnable then
for j := 0 to Count-1 do
if Values[j].TimeStamp64<>0 then
inc(result);
finally
LeaveCriticalSection(Mutex);
end;
end;
also
function TSQLRestCache.CachedEntries: cardinal;
Offline
Indeed.
We have enhanced TSQLRestCache.CachedEntries and TSQLRestCache.CachedMemory to be thread-safe.
See http://synopse.info/fossil/info/4fd6484a03e
Offline
Pages: 1