summaryrefslogtreecommitdiff
path: root/source/fitz/hash.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-02-17 10:30:59 +0100
committerTor Andersson <tor.andersson@artifex.com>2015-02-17 18:06:11 +0100
commit72679561cddc6b2586e596f62492b79dcf9f118d (patch)
tree25d156aacc2d2ac3e33170ec42b6501edb9b6754 /source/fitz/hash.c
parent6cc97e85489f5e4e39aa185d17ad5e35b09dddb5 (diff)
downloadmupdf-72679561cddc6b2586e596f62492b79dcf9f118d.tar.xz
Add helper functions to keep/drop reference counts with locking.
Add locks around fz_path and fz_text reference counting.
Diffstat (limited to 'source/fitz/hash.c')
-rw-r--r--source/fitz/hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/fitz/hash.c b/source/fitz/hash.c
index acd22334..f80e79b3 100644
--- a/source/fitz/hash.c
+++ b/source/fitz/hash.c
@@ -159,10 +159,10 @@ fz_resize_hash(fz_context *ctx, fz_hash_table *table, int newsize)
}
if (table->lock == FZ_LOCK_ALLOC)
- fz_unlock(ctx, FZ_LOCK_ALLOC);
+ fz_unlock(ctx, table->lock);
newents = fz_malloc_array_no_throw(ctx, newsize, sizeof(fz_hash_entry));
if (table->lock == FZ_LOCK_ALLOC)
- fz_lock(ctx, FZ_LOCK_ALLOC);
+ fz_lock(ctx, table->lock);
if (table->lock >= 0)
{
if (table->size >= newsize)
@@ -192,10 +192,10 @@ fz_resize_hash(fz_context *ctx, fz_hash_table *table, int newsize)
}
if (table->lock == FZ_LOCK_ALLOC)
- fz_unlock(ctx, FZ_LOCK_ALLOC);
+ fz_unlock(ctx, table->lock);
fz_free(ctx, oldents);
if (table->lock == FZ_LOCK_ALLOC)
- fz_lock(ctx, FZ_LOCK_ALLOC);
+ fz_lock(ctx, table->lock);
}
void *