Skip to content

Commit 6760545

Browse files
committed
Add critical section around ZSTD_DCtx_setParameter
1 parent b9415be commit 6760545

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/_zstd/decompressor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ _PyZstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
104104
}
105105

106106
/* Set parameter to compression context */
107+
Py_BEGIN_CRITICAL_SECTION(self);
107108
zstd_ret = ZSTD_DCtx_setParameter(self->dctx, key_v, value_v);
109+
Py_END_CRITICAL_SECTION();
108110

109111
/* Check error */
110112
if (ZSTD_isError(zstd_ret)) {

0 commit comments

Comments
 (0)