aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/data_writer/pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/data_writer/pthread.c')
-rw-r--r--lib/sqfs/data_writer/pthread.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqfs/data_writer/pthread.c b/lib/sqfs/data_writer/pthread.c
index 3cdf8fb..915ea2a 100644
--- a/lib/sqfs/data_writer/pthread.c
+++ b/lib/sqfs/data_writer/pthread.c
@@ -45,6 +45,7 @@ sqfs_data_writer_t *sqfs_data_writer_create(size_t max_block_size,
sqfs_file_t *file)
{
sqfs_data_writer_t *proc;
+ sigset_t set, oldset;
unsigned int i;
int ret;
@@ -79,6 +80,9 @@ sqfs_data_writer_t *sqfs_data_writer_create(size_t max_block_size,
goto fail_init;
}
+ sigfillset(&set);
+ pthread_sigmask(SIG_SETMASK, &set, &oldset);
+
for (i = 0; i < num_workers; ++i) {
ret = pthread_create(&proc->workers[i]->thread, NULL,
worker_proc, proc->workers[i]);
@@ -87,6 +91,8 @@ sqfs_data_writer_t *sqfs_data_writer_create(size_t max_block_size,
goto fail_thread;
}
+ pthread_sigmask(SIG_SETMASK, &oldset, NULL);
+
return proc;
fail_thread:
pthread_mutex_lock(&proc->mtx);
@@ -99,6 +105,7 @@ fail_thread:
pthread_join(proc->workers[i]->thread, NULL);
}
}
+ pthread_sigmask(SIG_SETMASK, &oldset, NULL);
fail_init:
for (i = 0; i < num_workers; ++i) {
if (proc->workers[i] != NULL) {