Tencent / LKImageKit

A high-performance image framework, including a series of capabilities such as image views, image downloader, memory caches, disk caches, image decoders and image processors.
Other
2.08k stars 287 forks source link

LKImageMemoryCache: fix thread conflict, add spinlock to protect conta… #19

Closed zq54zquan closed 6 years ago

zq54zquan commented 6 years ago

MemoryCache对外暴露的接口在多线程调用时可能会导致迭代器失效,分支中加上一个spinlock

kelingjie1 commented 6 years ago

MemoryCache is Only use in main Thread. A Assert will occur if developer using instance in other threads. So it should not have any locks because of high-performance.