From 728c961cde8eb5772d5033b067e68447e413aa07 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 28 Oct 2012 15:22:15 -0500 Subject: [PATCH 1/1] Add multi-mount program --- tests/multi-mount/Makefile | 7 +++++++ tests/multi-mount/multi-mount.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/multi-mount/Makefile create mode 100644 tests/multi-mount/multi-mount.c diff --git a/tests/multi-mount/Makefile b/tests/multi-mount/Makefile new file mode 100644 index 00000000..57ed7229 --- /dev/null +++ b/tests/multi-mount/Makefile @@ -0,0 +1,7 @@ +CFLAGS := -fopenmp +LDLIBS := -lwim +LDFLAGS := -fopenmp +multi-mount:multi-mount.c +clean: + rm -f multi-mount + diff --git a/tests/multi-mount/multi-mount.c b/tests/multi-mount/multi-mount.c new file mode 100644 index 00000000..8b932860 --- /dev/null +++ b/tests/multi-mount/multi-mount.c @@ -0,0 +1,31 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + int ret; + WIMStruct *w1; + WIMStruct *w2; + + assert(argc == 5); + ret = wimlib_open_wim(argv[1], 0, &w1); + assert(ret == 0); + + ret = wimlib_open_wim(argv[2], 0, &w2); + assert(ret == 0); + + #pragma omp parallel num_threads(2) + { + int ret; + assert(omp_get_num_threads() == 2); + if (omp_get_thread_num() == 0) + ret = wimlib_mount(w1, 1, argv[3], + WIMLIB_MOUNT_FLAG_DEBUG, NULL, 0); + else + ret = wimlib_mount(w2, 1, argv[4], + WIMLIB_MOUNT_FLAG_DEBUG, NULL, 0); + assert(ret == 0); + } + return 0; +} -- 2.43.0