From maxim@news1.macomnet.ru  Thu Dec  6 10:04:54 2001
Return-Path: <maxim@news1.macomnet.ru>
Received: from news1.macomnet.ru (news1.macomnet.ru [195.128.64.14])
	by hub.freebsd.org (Postfix) with ESMTP id AAE8E37B41A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  6 Dec 2001 10:04:53 -0800 (PST)
Received: (from maxim@localhost)
	by news1.macomnet.ru (8.11.1/8.11.1) id fB6I4q550011;
	Thu, 6 Dec 2001 21:04:52 +0300 (MSK)
	(envelope-from maxim)
Message-Id: <200112061804.fB6I4q550011@news1.macomnet.ru>
Date: Thu, 6 Dec 2001 21:04:52 +0300 (MSK)
From: maxim@macomnet.ru
Reply-To: maxim@macomnet.ru
To: FreeBSD-gnats-submit@freebsd.org
Subject: missed functions in pthread(3)
X-Send-Pr-Version: 3.2

>Number:         32561
>Category:       docs
>Synopsis:       missed functions in pthread(3)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    maxim
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 06 10:10:01 PST 2001
>Closed-Date:    Mon Mar 25 00:34:20 PST 2002
>Last-Modified:  Mon Mar 25 00:34:20 PST 2002
>Originator:     Maxim Konovalov, maxim@macomnet.ru
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
n/a
>Environment:

	FreeBSD 5.0-CURRENT i386

>Description:

	pthread(3) does not mention about

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

>How-To-Repeat:

	n/a

>Fix:

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

--
Maxim Konovalov, MAcomnet, Internet-Intranet Dept., system engineer
phone: +7 (095) 796-9079, mailto: maxim@macomnet.ru
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-doc->jasone 
Responsible-Changed-By: jasone 
Responsible-Changed-When: Mon Dec 17 12:46:08 PST 2001 
Responsible-Changed-Why:  
I'll take care of this. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32561 
State-Changed-From-To: open->analyzed 
State-Changed-By: maxim 
State-Changed-When: Mon Mar 11 02:45:30 PST 2002 
State-Changed-Why:  
The fix committed to -current. 


Responsible-Changed-From-To: jasone->maxim 
Responsible-Changed-By: maxim 
Responsible-Changed-When: Mon Mar 11 02:45:30 PST 2002 
Responsible-Changed-Why:  
I will MFC in two weeks. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32561 
State-Changed-From-To: analyzed->closed 
State-Changed-By: maxim 
State-Changed-When: Mon Mar 25 00:33:17 PST 2002 
State-Changed-Why:  
Fixed in rev. 1.21 and rev. 1.12.2.6 share/man/man3/pthread.3 in -current 
and -stable. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=32561 
>Unformatted:
