]> wimlib.net Git - wimlib/commitdiff
Merge branch 'lz_bt'
authorEric Biggers <ebiggers3@gmail.com>
Sat, 7 Jun 2014 21:34:14 +0000 (16:34 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 7 Jun 2014 21:34:14 +0000 (16:34 -0500)
NEWS
src/lzms-common.c
src/lzms-compress.c
src/write.c

diff --git a/NEWS b/NEWS
index 89157ebcfdf80b9e8f7bb840f02d6e1f6276737c..b703f8a62043b3f7d8c7e916c83167e09fed451e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,10 @@
 Only the most important changes more recent than version 0.6 are noted here.
 
 Version 1.7.0-BETA:
-       Improved compatibility with version 3584 WIM / ESD files.
+       Improved compatibility with version 3584 WIM / ESD files:
+           - Add support for reading and writing multiple solid blocks per
+             archive, which WIMGAPI/DISM can create when appending an image.
+           - Correctly create solid blocks larger than 4 GiB.
 
        Performance improvements, including for extraction.
 
index a34fb245265bc5dab3013535ec16198aed593cbf..c657ef4aabccd60f58df5c5061b8c2587e8b28d8 100644 (file)
@@ -165,17 +165,9 @@ lzms_compute_slots(void)
 void
 lzms_init_slots(void)
 {
-       static bool done = false;
-       static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-
-       if (unlikely(!done)) {
-               pthread_mutex_lock(&mutex);
-               if (!done) {
-                       lzms_compute_slots();
-                       done = true;
-               }
-               pthread_mutex_unlock(&mutex);
-       }
+       static pthread_once_t once = PTHREAD_ONCE_INIT;
+
+       pthread_once(&once, lzms_compute_slots);
 }
 
 static s32
index 0e9f0c3657d996bdaf9fe2dc669abc699e1e7961..a4d45300681f6871f14fcbec0886fb67cf9b3a6b 100644 (file)
@@ -116,7 +116,7 @@ struct lzms_range_encoder {
         * lzms_range_encoder_raw.  */
        struct lzms_range_encoder_raw *rc;
 
-       /* Bits recently encoded by this range encoder.  This are used as in
+       /* Bits recently encoded by this range encoder.  This is used as an
         * index into @prob_entries.  */
        u32 state;
 
@@ -669,17 +669,9 @@ lzms_do_init_rc_costs(void)
 static void
 lzms_init_rc_costs(void)
 {
-       static bool done = false;
-       static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-
-       if (unlikely(!done)) {
-               pthread_mutex_lock(&mutex);
-               if (!done) {
-                       lzms_do_init_rc_costs();
-                       done = true;
-               }
-               pthread_mutex_unlock(&mutex);
-       }
+       static pthread_once_t once = PTHREAD_ONCE_INIT;
+
+       pthread_once(&once, lzms_do_init_rc_costs);
 }
 
 /*
index 5217838192cdb886cf98cdea9474a718e7120ed1..aa3585a75b9fa7fd82c59cbed03a26539e3d2dc7 100644 (file)
@@ -451,7 +451,7 @@ begin_chunk_table(struct write_streams_ctx *ctx, u64 res_expected_size)
                reserve_size = expected_num_chunk_entries *
                               get_chunk_entry_size(res_expected_size,
                                                    0 != (ctx->write_resource_flags &
-                                                         WIM_RESHDR_FLAG_PACKED_STREAMS));
+                                                         WRITE_RESOURCE_FLAG_PACK_STREAMS));
                if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PACK_STREAMS)
                        reserve_size += sizeof(struct alt_chunk_table_header_disk);
                memset(ctx->chunk_csizes, 0, reserve_size);
@@ -499,7 +499,7 @@ end_chunk_table(struct write_streams_ctx *ctx, u64 res_actual_size,
 
        chunk_entry_size = get_chunk_entry_size(res_actual_size,
                                                0 != (ctx->write_resource_flags &
-                                                     WIM_RESHDR_FLAG_PACKED_STREAMS));
+                                                     WRITE_RESOURCE_FLAG_PACK_STREAMS));
 
        typedef le64 __attribute__((may_alias)) aliased_le64_t;
        typedef le32 __attribute__((may_alias)) aliased_le32_t;