Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
medialibrary
Commits
ca8d6b1f
Commit
ca8d6b1f
authored
May 22, 2014
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an helper to discard a value from cache
parent
b75e9ac5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
src/Cache.h
src/Cache.h
+10
-0
No files found.
src/Cache.h
View file @
ca8d6b1f
...
...
@@ -110,6 +110,16 @@ class Cache
Store
.
clear
();
}
static
bool
discard
(
const
typename
CACHEPOLICY
::
KeyType
&
key
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
Mutex
);
auto
it
=
Store
.
find
(
key
);
if
(
it
!=
Store
.
end
()
)
return
false
;
Store
.
erase
(
it
);
return
true
;
}
protected:
/*
* Create a new instance of the cache class.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment