Message ID | 1308156491-18488-3-git-send-email-asias.hejun@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/tools/kvm/threadpool.c b/tools/kvm/threadpool.c index 2db02184..fbd4887 100644 --- a/tools/kvm/threadpool.c +++ b/tools/kvm/threadpool.c @@ -5,6 +5,7 @@ #include <linux/list.h> #include <pthread.h> #include <stdbool.h> +#include <signal.h> struct thread_pool__job { kvm_thread_callback_fn_t callback; @@ -85,6 +86,9 @@ static void thread_pool__threadfunc_cleanup(void *param) static void *thread_pool__threadfunc(void *param) { + + sig_block(SIGALRM); + pthread_cleanup_push(thread_pool__threadfunc_cleanup, NULL); for (;;) {
thread pool thread is not interested in SIGALRM as well. Signed-off-by: Asias He <asias.hejun@gmail.com> --- tools/kvm/threadpool.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)