karlseguin / ccache

A golang LRU Cache for high concurrency
MIT License
1.28k stars 119 forks source link

Document thread-safety more clearly #33

Closed alecbz closed 4 years ago

alecbz commented 4 years ago

I imagine that it's safe to issue Get/Set/Fetch operations on the same cache from multiple threads, given the package is "aimed at high concurrency", and that the Clear method documents the opposite explicitly.

But if that's correct, might be good to call it out explicitly. Something like:

Unless otherwise noted (e.g., for Clear), methods on caches are thread-safe.

?

karlseguin commented 4 years ago

Sure https://github.com/karlseguin/ccache/commit/46ec5d225717743b9bc7e8b263a0fa1770130b84