Skip to content

Commit e30575a

Browse files
committed
Clarify why we need to check the same condition twice
1 parent 9f99259 commit e30575a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/blosc2/blosc2_ext.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,6 +1951,7 @@ cdef int aux_miniexpr(me_udata *udata, int64_t nchunk, int32_t nblock,
19511951
# We need to get the chunk from disk/network
19521952
if ndarr.chunk_cache.nchunk != nchunk:
19531953
PyThread_acquire_lock(chunk_cache_lock, 1)
1954+
# We need to check again, as another thread may have updated the cache already
19541955
if ndarr.chunk_cache.nchunk != nchunk:
19551956
if ndarr.chunk_cache.data != NULL:
19561957
free(ndarr.chunk_cache.data)

0 commit comments

Comments
 (0)