Skip to content

Commit 02e279f

Browse files
Merge pull request #18 from kuszmaul/bck-use-a-singleton
Don't use a symbol for the never-cached value
2 parents 92f4a2d + f642844 commit 02e279f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MultiThreadedCaches"
22
uuid = "18056a9e-ed0c-4ef3-9ad7-376a7fb08032"
33
authors = ["Nathan Daly <nhdaly@gmail.com> and contributors"]
4-
version = "0.1.4"
4+
version = "0.1.5"
55

66
[compat]
77
julia = "1.3"

src/MultiThreadedCaches.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ function _thread_lock(cache::MultiThreadedCache, tid)
118118
end
119119

120120

121-
const CACHE_MISS = :__MultiThreadedCaches_key_not_found__
121+
struct NeverCached end
122+
const CACHE_MISS = NeverCached()
122123

123124
function Base.get!(func::Base.Callable, cache::MultiThreadedCache{K,V}, key) where {K,V}
124125
# If the thread-local cache has the value, we can return immediately.

0 commit comments

Comments
 (0)