summaryrefslogtreecommitdiff
path: root/lib/sqfs/data_writer/internal.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-08 14:17:53 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-08 14:17:53 +0100
commitd98411f53939b7e308f186e5b61791677f3b0ad9 (patch)
treed284324dade1315e0508aea8a4ec821ece632b8c /lib/sqfs/data_writer/internal.h
parent9ea91c044106537453ae6e13368b60ce532c885c (diff)
Add native Windows port of the multi-threaded data writer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/data_writer/internal.h')
-rw-r--r--lib/sqfs/data_writer/internal.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/sqfs/data_writer/internal.h b/lib/sqfs/data_writer/internal.h
index fab6c50..312922b 100644
--- a/lib/sqfs/data_writer/internal.h
+++ b/lib/sqfs/data_writer/internal.h
@@ -25,6 +25,9 @@
#ifdef WITH_PTHREAD
#include <pthread.h>
#include <signal.h>
+#elif defined(_WIN32) || defined(__WINDOWS__)
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
#endif
@@ -53,6 +56,10 @@ struct sqfs_data_writer_t {
pthread_mutex_t mtx;
pthread_cond_t queue_cond;
pthread_cond_t done_cond;
+#elif defined(_WIN32) || defined(__WINDOWS__)
+ CRITICAL_SECTION mtx;
+ HANDLE queue_cond;
+ HANDLE done_cond;
#endif
/* needs rw access by worker and main thread */
@@ -102,7 +109,7 @@ struct sqfs_data_writer_t {
/* used only by workers */
size_t max_block_size;
-#ifdef WITH_PTHREAD
+#if defined(WITH_PTHREAD) || defined(_WIN32) || defined(__WINDOWS__)
compress_worker_t *workers[];
#else
sqfs_u8 scratch[];