* thread.cc: Update comment listing cancellation points per POSIX.

This commit is contained in:
Corinna Vinschen 2011-04-29 18:29:26 +00:00
parent 5735d5f6f4
commit 37e680bb6b
2 changed files with 305 additions and 173 deletions

View File

@ -1,3 +1,7 @@
2011-04-29 Corinna Vinschen <corinna@vinschen.de>
* thread.cc: Update comment listing cancellation points per POSIX.
2011-04-29 Corinna Vinschen <corinna@vinschen.de>
* advapi32.cc: Add comment.

View File

@ -562,181 +562,309 @@ pthread::cancel ()
ResumeThread (win32_obj_id);
return 0;
/*
TODO: insert pthread_testcancel into the required functions
the required function list is: *indicates done, X indicates not present in cygwin.
aio_suspend ()
*close ()
*creat ()
fcntl ()
fsync ()
getmsg ()
getpmsg ()
lockf ()
mq_receive ()
mq_send ()
msgrcv ()
msgsnd ()
msync ()
nanosleep ()
open ()
*pause ()
poll ()
pread ()
*pthread_cond_timedwait ()
*pthread_cond_wait ()
*pthread_join ()
*pthread_testcancel ()
putmsg ()
putpmsg ()
pwrite ()
read ()
readv ()
select ()
*sem_wait ()
*sigpause ()
*sigsuspend ()
sigtimedwait ()
sigwait ()
sigwaitinfo ()
*sleep ()
*system ()
tcdrain ()
*usleep ()
*wait ()
*wait3()
waitid ()
*waitpid ()
write ()
writev ()
the optional list is:
catclose ()
catgets ()
catopen ()
closedir ()
closelog ()
ctermid ()
dbm_close ()
dbm_delete ()
dbm_fetch ()
dbm_nextkey ()
dbm_open ()
dbm_store ()
dlclose ()
dlopen ()
endgrent ()
endpwent ()
endutxent ()
fclose ()
fcntl ()
fflush ()
fgetc ()
fgetpos ()
fgets ()
fgetwc ()
fgetws ()
fopen ()
fprintf ()
fputc ()
fputs ()
fputwc ()
fputws ()
fread ()
freopen ()
fscanf ()
fseek ()
fseeko ()
fsetpos ()
ftell ()
ftello ()
ftw ()
fwprintf ()
fwrite ()
fwscanf ()
getc ()
getc_unlocked ()
getchar ()
getchar_unlocked ()
getcwd ()
getdate ()
getgrent ()
getgrgid ()
getgrgid_r ()
getgrnam ()
getgrnam_r ()
getlogin ()
getlogin_r ()
getpwent ()
*getpwnam ()
*getpwnam_r ()
*getpwuid ()
*getpwuid_r ()
gets ()
getutxent ()
getutxid ()
getutxline ()
getw ()
getwc ()
getwchar ()
getwd ()
glob ()
iconv_close ()
iconv_open ()
ioctl ()
lseek ()
mkstemp ()
nftw ()
opendir ()
openlog ()
pclose ()
perror ()
popen ()
printf ()
putc ()
putc_unlocked ()
putchar ()
putchar_unlocked ()
puts ()
pututxline ()
putw ()
putwc ()
putwchar ()
readdir ()
readdir_r ()
remove ()
rename ()
rewind ()
rewinddir ()
scanf ()
seekdir ()
semop ()
setgrent ()
setpwent ()
setutxent ()
strerror ()
syslog ()
tmpfile ()
tmpnam ()
ttyname ()
ttyname_r ()
ungetc ()
ungetwc ()
unlink ()
vfprintf ()
vfwprintf ()
vprintf ()
vwprintf ()
wprintf ()
wscanf ()
Note, that for fcntl (), for any value of the cmd argument.
And we must not introduce cancellation points anywhere else that's part of the posix or
opengroup specs.
*/
}
/* TODO: Insert pthread_testcancel into the required functions.
Here are the lists of required and optional functions per POSIX.1-2001
and POSIX.1-2008. A start (*) indicates that the Cygwin function already
is a cancellation point (aka "calls pthread_testcancel").
Required cancellation points:
accept ()
aio_suspend ()
clock_nanosleep ()
* close ()
connect ()
* creat ()
fcntl () F_SETLKW
fdatasync ()
fsync ()
getmsg ()
getpmsg ()
lockf () F_LOCK
* mq_receive ()
* mq_send ()
* mq_timedreceive ()
* mq_timedsend ()
msgrcv ()
msgsnd ()
msync ()
nanosleep ()
open ()
openat ()
* pause ()
poll ()
pread ()
pselect ()
* pthread_cond_timedwait ()
* pthread_cond_wait ()
* pthread_join ()
* pthread_testcancel ()
putmsg ()
putpmsg ()
pwrite ()
read ()
readv ()
recv ()
recvfrom ()
recvmsg ()
select ()
* sem_timedwait ()
* sem_wait ()
send ()
sendmsg ()
sendto ()
* sigpause ()
* sigsuspend ()
sigtimedwait ()
sigwait ()
sigwaitinfo ()
* sleep ()
* system ()
tcdrain ()
* usleep ()
* wait ()
* wait3()
waitid ()
* waitpid ()
write ()
writev ()
Optional cancellation points:
access ()
asctime ()
asctime_r ()
catclose ()
catgets ()
catopen ()
chmod ()
chown ()
closedir ()
closelog ()
ctermid ()
ctime ()
ctime_r ()
dbm_close ()
dbm_delete ()
dbm_fetch ()
dbm_nextkey ()
dbm_open ()
dbm_store ()
dlclose ()
dlopen ()
dprintf ()
endgrent ()
endhostent ()
endnetent ()
endprotoent ()
endpwent ()
endservent ()
endutxent ()
faccessat ()
fchmod ()
fchmodat ()
fchown ()
fchownat ()
fclose ()
fcntl () (any value)
fflush ()
fgetc ()
fgetpos ()
fgets ()
fgetwc ()
fgetws ()
fmtmsg ()
fopen ()
fpathconf ()
fprintf ()
fputc ()
fputs ()
fputwc ()
fputws ()
fread ()
freopen ()
fscanf ()
fseek ()
fseeko ()
fsetpos ()
fstat ()
fstatat ()
ftell ()
ftello ()
ftw ()
futimens ()
fwprintf ()
fwrite ()
fwscanf ()
getaddrinfo ()
getc ()
getc_unlocked ()
getchar ()
getchar_unlocked ()
getcwd ()
getdate ()
getdelim ()
getgrent ()
getgrgid ()
getgrgid_r ()
getgrnam ()
getgrnam_r ()
gethostbyaddr ()
gethostbyname ()
gethostent ()
gethostid ()
gethostname ()
getline ()
getlogin ()
getlogin_r ()
getnameinfo ()
getnetbyaddr ()
getnetbyname ()
getnetent ()
getopt () (if opterr is nonzero)
getprotobyname ()
getprotobynumber ()
getprotoent ()
getpwent ()
* getpwnam ()
* getpwnam_r ()
* getpwuid ()
* getpwuid_r ()
gets ()
getservbyname ()
getservbyport ()
getservent ()
getutxent ()
getutxid ()
getutxline ()
getwc ()
getwchar ()
getwd ()
glob ()
iconv_close ()
iconv_open ()
ioctl ()
link ()
linkat ()
lio_listio ()
localtime ()
localtime_r ()
lockf ()
lseek ()
lstat ()
mkdir ()
mkdirat ()
mkdtemp ()
mkfifo ()
mkfifoat ()
mknod ()
mknodat ()
mkstemp ()
mktime ()
nftw ()
opendir ()
openlog ()
pathconf ()
pclose ()
perror ()
popen ()
posix_fadvise ()
posix_fallocate ()
posix_madvise ()
posix_openpt ()
posix_spawn ()
posix_spawnp ()
posix_trace_clear ()
posix_trace_close ()
posix_trace_create ()
posix_trace_create_withlog ()
posix_trace_eventtypelist_getnext_id ()
posix_trace_eventtypelist_rewind ()
posix_trace_flush ()
posix_trace_get_attr ()
posix_trace_get_filter ()
posix_trace_get_status ()
posix_trace_getnext_event ()
posix_trace_open ()
posix_trace_rewind ()
posix_trace_set_filter ()
posix_trace_shutdown ()
posix_trace_timedgetnext_event ()
posix_typed_mem_open ()
printf ()
psiginfo ()
psignal ()
pthread_rwlock_rdlock ()
pthread_rwlock_timedrdlock ()
pthread_rwlock_timedwrlock ()
pthread_rwlock_wrlock ()
putc ()
putc_unlocked ()
putchar ()
putchar_unlocked ()
puts ()
pututxline ()
putwc ()
putwchar ()
readdir ()
readdir_r ()
readlink ()
readlinkat ()
remove ()
rename ()
renameat ()
rewind ()
rewinddir ()
scandir ()
scanf ()
seekdir ()
semop ()
setgrent ()
sethostent ()
setnetent ()
setprotoent ()
setpwent ()
setservent ()
setutxent ()
sigpause ()
stat ()
strerror ()
strerror_r ()
strftime ()
symlink ()
symlinkat ()
sync ()
syslog ()
tmpfile ()
tmpnam ()
ttyname ()
ttyname_r ()
tzset ()
ungetc ()
ungetwc ()
unlink ()
unlinkat ()
utime ()
utimensat ()
utimes ()
vdprintf ()
vfprintf ()
vfwprintf ()
vprintf ()
vwprintf ()
wcsftime ()
wordexp ()
wprintf ()
wscanf ()
An implementation may also mark other functions not specified in the
standard as cancellation points. In particular, an implementation is
likely to mark any nonstandard function that may block as a
cancellation point. */
void
pthread::testcancel ()
{