summaryrefslogtreecommitdiff
path: root/source/cbz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2018-04-05 15:35:07 +0100
committerRobin Watts <robin.watts@artifex.com>2018-04-06 16:09:53 +0100
commit50dc275b852c52375ad583bcfae2127dcc34e3e3 (patch)
treee4dce6dbc8a7f0668f7ccf46dadb58258de996a1 /source/cbz
parent699c85ae3b04a5bfb4d6fa68e7ca4d15d3c794a2 (diff)
downloadmupdf-50dc275b852c52375ad583bcfae2127dcc34e3e3.tar.xz
Fix store multi-threading problem.
While running 'ensure_space', we can drop and retake the alloc lock. This can enable other threads to perform store operations, which can trigger reaps. When reaps happen, fz_item's are discarded. This is particularly bad when ensure_space happens to be holding onto a pointer to one (prev). The fix, implemented here, is to move items out of the store list (and hash table), and put them onto a local 'to_be_freed' list. Once on this local list we can be sure that they won't be found by other threads doing store operations, and they can be safely freed from there (dropping/retaking the lock as required).
Diffstat (limited to 'source/cbz')
0 files changed, 0 insertions, 0 deletions