On 03/06/2013 05:49 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" <berrange@xxxxxxxxxx> > > Add a virThreadCancel function. This functional is inherantly s/inherantly/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@xxxxxxxxxx> > --- > src/libvirt_private.syms | 1 + > src/util/virthread.h | 1 + > src/util/virthreadpthread.c | 5 +++++ > 3 files changed, 7 insertions(+) > > +++ b/src/util/virthreadpthread.c > @@ -236,6 +236,11 @@ void virThreadJoin(virThreadPtr thread) > pthread_join(thread->thread, NULL); > } > > +void virThreadCancel(virThreadPtr thread) It would help to add documentation right before this implementation that mentions that the function exists SOLELY for use by threads created by third-party libraries which are prepared for cancellation, and that most libvirt threads do not qualify. Having the discouraging comment tucked away solely in the commit message won't help a future coder who doesn't realize the dangers. ACK with the comment added. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list