From 268d2fe602ed1dbc417c389a9b52010b2da888af Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 27 Aug 2016 23:13:20 -0700 Subject: [PATCH] libdeflate.h: add note about thread-safety --- libdeflate.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libdeflate.h b/libdeflate.h index 918e3ec..c7c220b 100644 --- a/libdeflate.h +++ b/libdeflate.h @@ -44,6 +44,9 @@ struct libdeflate_compressor; * Note: for compression, the sliding window size is defined at compilation time * to 32768, the largest size permissible in the DEFLATE format. It cannot be * changed at runtime. + * + * A single compressor is not safe to use by multiple threads concurrently. + * However, different threads may use different compressors concurrently. */ LIBDEFLATEAPI struct libdeflate_compressor * libdeflate_alloc_compressor(unsigned int compression_level); @@ -147,6 +150,9 @@ struct libdeflate_decompressor; * This function takes no parameters, and the returned decompressor is valid for * decompressing data that was compressed at any compression level and with any * sliding window size. + * + * A single decompressor is not safe to use by multiple threads concurrently. + * However, different threads may use different decompressors concurrently. */ LIBDEFLATEAPI struct libdeflate_decompressor * libdeflate_alloc_decompressor(void);