mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-28 16:43:09 +00:00
635f917a9d
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@ |
||
---|---|---|
.. | ||
bind | ||
clang | ||
csu | ||
libalias | ||
libarchive | ||
libauditd | ||
libautofs | ||
libbegemot | ||
libbluetooth | ||
libbsm | ||
libbsnmp | ||
libbz2 | ||
libc | ||
libc_r | ||
libcalendar | ||
libcam | ||
libcom_err | ||
libcompat | ||
libcrypt | ||
libdevinfo | ||
libdevstat | ||
libdisk | ||
libdwarf | ||
libedit | ||
libefi | ||
libelf | ||
libexpat | ||
libfetch | ||
libftpio | ||
libgeom | ||
libgpib | ||
libgssapi | ||
libipsec | ||
libipx | ||
libjail | ||
libkiconv | ||
libkse | ||
libkvm | ||
liblzma | ||
libmagic | ||
libmd | ||
libmemstat | ||
libmilter | ||
libmp | ||
libncp | ||
libnetgraph | ||
libngatm | ||
libopie | ||
libpam | ||
libpcap | ||
libpkg | ||
libpmc | ||
libproc | ||
libradius | ||
librpcsec_gss | ||
librpcsvc | ||
librt | ||
librtld_db | ||
libsbuf | ||
libsdp | ||
libsm | ||
libsmb | ||
libsmdb | ||
libsmutil | ||
libstand | ||
libtacplus | ||
libtelnet | ||
libthr | ||
libthread_db | ||
libufs | ||
libugidfw | ||
libulog | ||
libusb | ||
libusbhid | ||
libutil | ||
libvgl | ||
libwrap | ||
liby | ||
libypclnt | ||
libz | ||
msun | ||
ncurses | ||
Makefile | ||
Makefile.inc |