]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Use threads in streaming_compression.c example. 2231/head
authorMartin Liska <mliska@suse.cz>
Wed, 8 Jul 2020 10:09:00 +0000 (12:09 +0200)
committerMartin Liska <mliska@suse.cz>
Thu, 9 Jul 2020 07:20:06 +0000 (09:20 +0200)
Fixes #1584.

examples/streaming_compression.c

index f0f1065b1d27511f13368f6de350b378b1e74e35..045437f2873de92528b36f44ac49e16ca21b86b5 100644 (file)
@@ -39,6 +39,7 @@ static void compressFile_orDie(const char* fname, const char* outName, int cLeve
      */
     CHECK_ZSTD( ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, cLevel) );
     CHECK_ZSTD( ZSTD_CCtx_setParameter(cctx, ZSTD_c_checksumFlag, 1) );
+    ZSTD_CCtx_setParameter(cctx, ZSTD_c_nbWorkers, 4);
 
     /* This loop read from the input file, compresses that entire chunk,
      * and writes all output produced to the output file.