summaryrefslogtreecommitdiff
path: root/libmultipath/lock.c
blob: 4439a51ee5be63a4a116c56fd88cbb613a31f737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <pthread.h>
#include <signal.h>
#include "lock.h"
#include <stdio.h>

void block_signal (int signum, sigset_t *old)
{
	sigset_t set;
	sigemptyset(&set);
	sigaddset(&set, signum);
	pthread_sigmask(SIG_BLOCK, &set, old);
}

void cleanup_lock (void * data)
{
	unlock ((*(struct mutex_lock *)data));
}