mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
Add API for thread cancellation
Add a virThreadCancel function. This functional is inherently dangerous and not something we want to use in general, but integration with SELinux requires that we provide this stub. We leave out any Win32 impl to discourage further use and because obviously SELinux isn't enabled on Win32 Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
32b7e92db6
commit
a299714295
@ -1744,6 +1744,7 @@ virMutexInitRecursive;
|
|||||||
virMutexLock;
|
virMutexLock;
|
||||||
virMutexUnlock;
|
virMutexUnlock;
|
||||||
virOnce;
|
virOnce;
|
||||||
|
virThreadCancel;
|
||||||
virThreadCreate;
|
virThreadCreate;
|
||||||
virThreadID;
|
virThreadID;
|
||||||
virThreadInitialize;
|
virThreadInitialize;
|
||||||
|
@ -55,6 +55,10 @@ void virThreadSelf(virThreadPtr thread);
|
|||||||
bool virThreadIsSelf(virThreadPtr thread);
|
bool virThreadIsSelf(virThreadPtr thread);
|
||||||
void virThreadJoin(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
|
/* These next two functions are for debugging only, since they are not
|
||||||
* guaranteed to give unique values for distinct threads on all
|
* guaranteed to give unique values for distinct threads on all
|
||||||
* architectures, nor are the two functions guaranteed to give the same
|
* architectures, nor are the two functions guaranteed to give the same
|
||||||
|
@ -236,6 +236,11 @@ void virThreadJoin(virThreadPtr thread)
|
|||||||
pthread_join(thread->thread, NULL);
|
pthread_join(thread->thread, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void virThreadCancel(virThreadPtr thread)
|
||||||
|
{
|
||||||
|
pthread_cancel(thread->thread);
|
||||||
|
}
|
||||||
|
|
||||||
int virThreadLocalInit(virThreadLocalPtr l,
|
int virThreadLocalInit(virThreadLocalPtr l,
|
||||||
virThreadLocalCleanup c)
|
virThreadLocalCleanup c)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user