Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
ca8d6b1f
Commit
ca8d6b1f
authored
May 22, 2014
by
Hugo Beauzée-Luyssen
Browse files
Add an helper to discard a value from cache
parent
b75e9ac5
Changes
1
Hide whitespace changes
Inline
Side-by-side
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