1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-28 16:43:09 +00:00
freebsd/lib
David Xu 635f917a9d In current implementation, thread cancellation is done in signal handler,
which does not know what is the state of interrupted system call, for
example, open() system call opened a file and the thread is still cancelled,
result is descriptor leak, there are other problems which can cause resource
leak or undeterminable side effect when a thread is cancelled. However, this
is no longer true in new implementation.

  In defering mode, a thread is canceled if cancellation request is pending and
later the thread enters a cancellation point, otherwise, a later
pthread_cancel() just causes SIGCANCEL to be sent to the target thread, and
causes target thread to abort system call, userland code in libthr then checks
cancellation state, and cancels the thread if needed. For example, the
cancellation point open(), the thread may be canceled at start,
but later, if it opened a file descriptor, it is not canceled, this avoids
file handle leak. Another example is read(), a thread may be canceled at start
of the function, but later, if it read some bytes from a socket, the thread
is not canceled, the caller then can decide if it should still enable cancelling
or disable it and continue reading data until it thinks it has read all
bytes of a packet, and keeps a protocol stream in health state, if user ignores
partly reading of a packet without disabling cancellation, then second iteration
of read loop cause the thread to be cancelled.
An exception is that the close() cancellation point always closes a file handle
despite whether the thread is cancelled or not.

  The old mechanism is still kept, for a functions which is not so easily to
fix a cancellation problem, the rough mechanism is used.

Reviewed by: kib@
2010-08-20 05:15:39 +00:00
..
bind Since powerpc and powerpc64 share an instruction set, bind can and should 2010-07-10 17:46:53 +00:00
clang Build clang libraries by default with -fno-exceptions and with 2010-07-22 19:09:34 +00:00
csu C startup support for 64-bit PowerPC. 2010-07-10 03:45:55 +00:00
libalias
libarchive Fix typo. 2010-08-03 18:29:58 +00:00
libauditd
libautofs
libbegemot
libbluetooth Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libbsm
libbsnmp
libbz2
libc Use aux vector to get values for SSP canary, pagesize, pagesizes array, 2010-08-17 09:13:26 +00:00
libc_r
libcalendar
libcam Fix typos and spelling mistakes. 2010-08-06 14:33:42 +00:00
libcom_err
libcompat Small style(9) fix: use tabs instead of spaces. 2010-08-08 08:19:23 +00:00
libcrypt
libdevinfo
libdevstat Spelling fixes. 2010-08-03 17:40:09 +00:00
libdisk
libdwarf
libedit Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libefi Spelling fixes. 2010-08-03 17:40:09 +00:00
libelf Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libexpat Fix buildworld -DNO_CLEAN when using with Perforce, which marks files as 2010-08-12 20:46:49 +00:00
libfetch Redo fetch_read() using non-blocking sockets. This is necessary to 2010-07-28 16:11:22 +00:00
libftpio mdoc: consistently spell our email addresses <foo@FreeBSD.org> 2010-05-19 08:57:53 +00:00
libgeom Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libgpib Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libgssapi Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libipsec
libipx
libjail Don't copy and return a potentially unset buffer when jail_get fails. 2010-07-15 19:21:33 +00:00
libkiconv
libkse Merge from tbemd: 2010-06-13 01:27:29 +00:00
libkvm mdoc: make sure to pass at least one argument to quotation macros 2010-08-02 13:11:35 +00:00
liblzma Unbreak xz (liblzma) on strong-aligned architectures (and without 2010-07-15 03:11:04 +00:00
libmagic Use CFLAGS and LDFLAGS when compiling mkmagic. This ensures that all the 2010-08-01 12:10:32 +00:00
libmd
libmemstat Spelling fixes. 2010-08-03 17:40:09 +00:00
libmilter
libmp
libncp
libnetgraph
libngatm
libopie
libpam Bump .Dd date. 2010-05-03 09:49:42 +00:00
libpcap
libpkg - Take libinstall.a out of pkg_install and make it a proper shared library. 2010-04-23 11:07:43 +00:00
libpmc Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libproc Several fixes for libproc: 2010-08-11 17:33:26 +00:00
libradius Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
librpcsec_gss Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
librpcsvc
librt
librtld_db Spelling fixes. 2010-08-03 17:40:09 +00:00
libsbuf
libsdp Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libsm
libsmb
libsmdb
libsmutil
libstand Use type-specific inline function imax() instead of deprecated macro MAX(). 2010-07-12 15:32:45 +00:00
libtacplus
libtelnet
libthr In current implementation, thread cancellation is done in signal handler, 2010-08-20 05:15:39 +00:00
libthread_db Powerpc64 thread libraries support. 2010-07-10 15:13:49 +00:00
libufs Search beyond the first 1/8th of inodes. 2010-05-01 18:56:45 +00:00
libugidfw mdoc: order prologue macros consistently by Dd/Dt/Os 2010-04-14 19:08:06 +00:00
libulog mdoc: order prologue macros consistently by Dd/Dt/Os 2010-04-14 19:08:06 +00:00
libusb Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libusbhid Use fixed width integer types for parsing the binary hid data. 2010-05-13 02:03:00 +00:00
libutil Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libvgl
libwrap
liby
libypclnt
libz MFV: zlib 1.2.5. 2010-04-20 21:14:30 +00:00
msun Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
ncurses
Makefile Build librtld_db. 2010-07-31 16:12:47 +00:00
Makefile.inc