#include <fuse.h>
#include <limits.h>
#include <mqueue.h>
-#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include "wimlib/paths.h"
#include "wimlib/progress.h"
#include "wimlib/reparse.h"
+#include "wimlib/threads.h"
#include "wimlib/timestamp.h"
#include "wimlib/unix_data.h"
#include "wimlib/write.h"
struct wimfs_unmount_info unmount_info;
mqd_t mq;
struct commit_progress_thread_args args;
- pthread_t commit_progress_tid;
+ struct thread commit_progress_tid;
int ret;
memset(&unmount_info, 0, sizeof(unmount_info));
args.mq = mq;
args.progfunc = progfunc;
args.progctx = progctx;
- ret = pthread_create(&commit_progress_tid, NULL,
- commit_progress_thread_proc, &args);
- if (ret) {
- errno = ret;
- ERROR_WITH_ERRNO("Can't create thread");
+ if (!thread_create(&commit_progress_tid,
+ commit_progress_thread_proc, &args)) {
ret = WIMLIB_ERR_NOMEM;
goto out_delete_mq;
}
/* Terminate the progress thread. */
char empty[1];
mq_send(mq, empty, 0, 1);
- pthread_join(commit_progress_tid, NULL);
+ thread_join(&commit_progress_tid);
}
out_delete_mq:
if (progfunc) {