Module Name: src Committed By: christos Date: Fri Aug 6 05:25:46 UTC 2010
Modified Files: src/lib/libpthread: pthread_cancelstub.c pthread_testcancel.3 Log Message: make kevent(2) a cancelation point, and document properly all the cancelation points we currently support. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/lib/libpthread/pthread_cancelstub.c cvs rdiff -u -r1.5 -r1.6 src/lib/libpthread/pthread_testcancel.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libpthread/pthread_cancelstub.c diff -u src/lib/libpthread/pthread_cancelstub.c:1.27 src/lib/libpthread/pthread_cancelstub.c:1.28 --- src/lib/libpthread/pthread_cancelstub.c:1.27 Wed Aug 12 19:51:23 2009 +++ src/lib/libpthread/pthread_cancelstub.c Fri Aug 6 01:25:46 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_cancelstub.c,v 1.27 2009/08/12 23:51:23 enami Exp $ */ +/* $NetBSD: pthread_cancelstub.c,v 1.28 2010/08/06 05:25:46 christos Exp $ */ /*- * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: pthread_cancelstub.c,v 1.27 2009/08/12 23:51:23 enami Exp $"); +__RCSID("$NetBSD: pthread_cancelstub.c,v 1.28 2010/08/06 05:25:46 christos Exp $"); #ifndef lint @@ -65,10 +65,12 @@ #include <sys/mman.h> #include <sys/select.h> #include <sys/socket.h> +#include <sys/event.h> #include <compat/sys/mman.h> #include <compat/sys/poll.h> #include <compat/sys/select.h> +#include <compat/sys/event.h> #include <compat/sys/wait.h> #include <compat/include/mqueue.h> #include <compat/include/signal.h> @@ -89,6 +91,8 @@ int _sys_fdatasync(int); int _sys_fsync(int); int _sys_fsync_range(int, int, off_t, off_t); +int _sys___kevent50(int, const struct kevent *, size_t, struct kevent *, + size_t, const struct timespec *); int _sys_mq_send(mqd_t, const char *, size_t, unsigned); ssize_t _sys_mq_receive(mqd_t, char *, size_t, unsigned *); int _sys___mq_timedsend50(mqd_t, const char *, size_t, unsigned, @@ -155,6 +159,21 @@ } int +__kevent50(int fd, const struct kevent *ev, size_t nev, struct kevent *rev, + size_t nrev, const struct timespec *ts) +{ + int retval; + pthread_t self; + + self = pthread__self(); + TESTCANCEL(self); + retval = _sys___kevent50(fd, ev, nev, rev, nrev, ts); + TESTCANCEL(self); + + return retval; +} + +int close(int d) { int retval; Index: src/lib/libpthread/pthread_testcancel.3 diff -u src/lib/libpthread/pthread_testcancel.3:1.5 src/lib/libpthread/pthread_testcancel.3:1.6 --- src/lib/libpthread/pthread_testcancel.3:1.5 Fri Jul 9 04:51:28 2010 +++ src/lib/libpthread/pthread_testcancel.3 Fri Aug 6 01:25:46 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: pthread_testcancel.3,v 1.5 2010/07/09 08:51:28 jruoho Exp $ +.\" $NetBSD: pthread_testcancel.3,v 1.6 2010/08/06 05:25:46 christos Exp $ .\" .\" Copyright (c) 2002 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -23,7 +23,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD: src/lib/libpthread/man/pthread_testcancel.3,v 1.9 2002/09/16 19:29:29 mini Exp $ -.Dd July 9, 2010 +.Dd Auguest 6, 2010 .Dt PTHREAD_TESTCANCEL 3 .Os .Sh NAME @@ -124,21 +124,23 @@ Cancellation points will occur when a thread is executing the following functions: .Fn accept , -.\".Fn aio_suspend , -.\".Fn clock_nanosleep , +.Fn aio_suspend , +.Fn clock_nanosleep , .Fn close , .Fn connect , .Fn creat , .Fn fcntl , +.Fn fdatasync , .Fn fsync , .Fn fsync_range , .\".Fn getmsg , .\".Fn getpmsg , +.Fn kevent , .\".Fn lockf , -.\".Fn mq_receive , -.\".Fn mq_send , -.\".Fn mq_timedreceive , -.\".Fn mq_timedsend , +.Fn mq_receive , +.Fn mq_send , +.Fn mq_timedreceive , +.Fn mq_timedsend , .Fn msgrcv , .Fn msgsnd , .Fn msync , @@ -146,6 +148,7 @@ .Fn open , .Fn pause , .Fn poll , +.Fn pollts , .Fn pread , .Fn pselect , .Fn pthread_cond_timedwait , @@ -176,6 +179,7 @@ .Fn tcdrain , .Fn usleep , .Fn wait , +.Fn wait4 , .Fn waitid , .Fn waitpid , .Fn write ,