8b932860ee96fd84e32918eac9b33f62ff0fe19d
[wimlib] / tests / multi-mount / multi-mount.c
1 #include <wimlib.h>
2 #include <assert.h>
3 #include <omp.h>
4
5 int main(int argc, char **argv)
6 {
7         int ret;
8         WIMStruct *w1;
9         WIMStruct *w2;
10
11         assert(argc == 5);
12         ret = wimlib_open_wim(argv[1], 0, &w1);
13         assert(ret == 0);
14
15         ret = wimlib_open_wim(argv[2], 0, &w2);
16         assert(ret == 0);
17
18         #pragma omp parallel num_threads(2)
19         {
20                 int ret;
21                 assert(omp_get_num_threads() == 2);
22                 if (omp_get_thread_num() == 0)
23                         ret = wimlib_mount(w1, 1, argv[3],
24                                            WIMLIB_MOUNT_FLAG_DEBUG, NULL, 0);
25                 else
26                         ret = wimlib_mount(w2, 1, argv[4],
27                                            WIMLIB_MOUNT_FLAG_DEBUG, NULL, 0);
28                 assert(ret == 0);
29         }
30         return 0;
31 }