diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 599b71edd3..8fe0b97a4f 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1744,6 +1744,7 @@ virMutexInitRecursive; virMutexLock; virMutexUnlock; virOnce; +virThreadCancel; virThreadCreate; virThreadID; virThreadInitialize; diff --git a/src/util/virthread.h b/src/util/virthread.h index c59a2cfddf..ca1306a8ab 100644 --- a/src/util/virthread.h +++ b/src/util/virthread.h @@ -55,6 +55,10 @@ void virThreadSelf(virThreadPtr thread); bool virThreadIsSelf(virThreadPtr thread); void virThreadJoin(virThreadPtr thread); +/* This API is *NOT* for general use. It exists solely as a stub + * for integration with libselinux AVC callbacks */ +void virThreadCancel(virThreadPtr thread); + /* These next two functions are for debugging only, since they are not * guaranteed to give unique values for distinct threads on all * architectures, nor are the two functions guaranteed to give the same diff --git a/src/util/virthreadpthread.c b/src/util/virthreadpthread.c index 9f02ba1b04..b42b333853 100644 --- a/src/util/virthreadpthread.c +++ b/src/util/virthreadpthread.c @@ -236,6 +236,11 @@ void virThreadJoin(virThreadPtr thread) pthread_join(thread->thread, NULL); } +void virThreadCancel(virThreadPtr thread) +{ + pthread_cancel(thread->thread); +} + int virThreadLocalInit(virThreadLocalPtr l, virThreadLocalCleanup c) {