Bug 32561

Summary: missed functions in pthread(3)
Product: Documentation Reporter: Maxim Konovalov <maxim>
Component: Books & ArticlesAssignee: Maxim Konovalov <maxim>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Maxim Konovalov 2001-12-06 18:10:01 UTC
	pthread(3) does not mention about

		pthread_kill()
		pthread_setcancelstate()
		pthread_setcanceltype()
		pthread_testcancel()
		pthread_yield()

Fix: 

--
Maxim Konovalov, MAcomnet, Internet-Intranet Dept., system engineer
phone: +7 (095) 796-9079, mailto: maxim@macomnet.ru--7xtaDcf7sXamAL3OGRPEtDiw5efZTes2fA1Qyt2Stvkxggb1
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

Index: pthread.3
===================================================================
RCS file: /home/ncvs/src/share/man/man3/pthread.3,v
retrieving revision 1.20
diff -u -r1.20 pthread.3
--- pthread.3	1 Oct 2001 16:09:20 -0000	1.20
+++ pthread.3	2 Dec 2001 12:13:47 -0000
@@ -73,6 +73,11 @@
 Creates a new thread of execution.
 .It Xo
 .Ft int
+.Fn pthread_cancel "pthread_t thread"
+.Xc
+Cancels execution of a thread.
+.It Xo
+.Ft int
 .Fn pthread_detach "pthread_t thread"
 .Xc
 Marks a thread for deletion.
@@ -93,9 +98,9 @@
 Causes the calling thread to wait for the termination of the specified thread.
 .It Xo
 .Ft int
-.Fn pthread_cancel "pthread_t thread"
+.Fn pthread_kill "pthread_t thread" "int sig"
 .Xc
-Cancels execution of a thread.
+Delivers a signal to a specified thread.
 .It Xo
 .Ft int
 .Fn pthread_once "pthread_once_t *once_control" "void (*init_routine)(void)"
@@ -106,6 +111,26 @@
 .Fn pthread_self void
 .Xc
 Returns the thread ID of the calling thread.
+.It Xo
+.Ft int
+.Fn pthread_setcancelstate "int state" "int *oldstate"
+.Xc
+Sets the current thread's cancelability state.
+.It Xo
+.Ft int
+.Fn pthread_setcanceltype "int type" "int *oldtype"
+.Xc
+Sets the current thread's cancelability type.
+.It Xo
+.Ft void
+.Fn pthread_testcancel void
+.Xc
+Creates a cancellation point in the calling thread.
+.It Xo
+.Ft void
+.Fn pthread_yield void
+.Xc
+Allows the scheduler to run another thread instead of the current one.
 .El
 .Sh ATTRIBUTE OBJECT ROUTINES
 .Bl -tag -width Er
@@ -415,6 +440,7 @@
 .Xr pthread_getspecific 3 ,
 .Xr pthread_join 3 ,
 .Xr pthread_key_delete 3 ,
+.Xr pthread_kill 3 ,
 .Xr pthread_mutex_destroy 3 ,
 .Xr pthread_mutex_init 3 ,
 .Xr pthread_mutex_lock 3 ,
@@ -431,7 +457,10 @@
 .Xr pthread_rwlock_unlock 3 ,
 .Xr pthread_rwlock_wrlock 3 ,
 .Xr pthread_self 3 ,
-.Xr pthread_setspecific 3
+.Xr pthread_setspecific 3 ,
+.Xr pthread_setcancelstate 3 ,
+.Xr pthread_setcanceltype 3 ,
+.Xr pthread_testcancel 3
 .Sh STANDARDS
 The functions in
 .Fa libc_r
How-To-Repeat: 
	n/a
Comment 1 Jason Evans freebsd_committer freebsd_triage 2001-12-17 20:46:08 UTC
Responsible Changed
From-To: freebsd-doc->jasone

I'll take care of this.
Comment 2 Maxim Konovalov freebsd_committer freebsd_triage 2002-03-11 10:45:30 UTC
State Changed
From-To: open->analyzed

The fix committed to -current. 


Comment 3 Maxim Konovalov freebsd_committer freebsd_triage 2002-03-11 10:45:30 UTC
Responsible Changed
From-To: jasone->maxim

I will MFC in two weeks.
Comment 4 Maxim Konovalov freebsd_committer freebsd_triage 2002-03-25 08:33:17 UTC
State Changed
From-To: analyzed->closed

Fixed in rev. 1.21 and rev. 1.12.2.6 share/man/man3/pthread.3 in -current 
and -stable.