Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libpthread Finally, split pthread_attr_getschedpolicy() ...
details: https://anonhg.NetBSD.org/src/rev/388db8f8c814
branches: trunk
changeset: 756162:388db8f8c814
user: jruoho <jruoho%NetBSD.org@localhost>
date: Wed Jul 07 16:22:30 2010 +0000
description:
Finally, split pthread_attr_getschedpolicy() and pthread_attr_setschedpolicy()
to their own page.
diffstat:
lib/libpthread/Makefile | 6 +-
lib/libpthread/pthread_attr.3 | 32 ++--------
lib/libpthread/pthread_attr_getschedpolicy.3 | 81 ++++++++++++++++++++++++++++
3 files changed, 91 insertions(+), 28 deletions(-)
diffs (187 lines):
diff -r c67ded4d8bf1 -r 388db8f8c814 lib/libpthread/Makefile
--- a/lib/libpthread/Makefile Wed Jul 07 16:19:55 2010 +0000
+++ b/lib/libpthread/Makefile Wed Jul 07 16:22:30 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.64 2010/07/07 16:04:19 jruoho Exp $
+# $NetBSD: Makefile,v 1.65 2010/07/07 16:22:30 jruoho Exp $
#
WARNS= 4
@@ -95,6 +95,7 @@
pthread_attr_getinheritsched.3 \
pthread_attr_getname_np.3 \
pthread_attr_getschedparam.3 \
+ pthread_attr_getschedpolicy.3 \
pthread_attr_getscope.3 \
pthread_attr_getstack.3 \
pthread_attr_setcreatesuspend_np.3 \
@@ -125,13 +126,12 @@
MLINKS+= pthread_attr.3 pthread_attr_init.3
MLINKS+= pthread_attr.3 pthread_attr_destroy.3
-MLINKS+= pthread_attr.3 pthread_attr_setschedpolicy.3
-MLINKS+= pthread_attr.3 pthread_attr_getschedpolicy.3
MLINKS+= pthread_attr_getdetachstate.3 pthread_attr_setdetachstate.3
MLINKS+= pthread_attr_getguardsize.3 pthread_attr_setguardsize.3
MLINKS+= pthread_attr_getinheritsched.3 pthread_attr_setinheritsched.3
MLINKS+= pthread_attr_getschedparam.3 pthread_attr_setschedparam.3
+MLINKS+= pthread_attr_getschedpolicy.3 pthread_attr_setschedpolicy.3
MLINKS+= pthread_attr_getscope.3 pthread_attr_setscope.3
MLINKS+= pthread_attr_getstack.3 pthread_attr_setstack.3 \
pthread_attr_getstack.3 pthread_attr_getstacksize.3 \
diff -r c67ded4d8bf1 -r 388db8f8c814 lib/libpthread/pthread_attr.3
--- a/lib/libpthread/pthread_attr.3 Wed Jul 07 16:19:55 2010 +0000
+++ b/lib/libpthread/pthread_attr.3 Wed Jul 07 16:22:30 2010 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pthread_attr.3,v 1.17 2010/07/07 16:04:19 jruoho Exp $
+.\" $NetBSD: pthread_attr.3,v 1.18 2010/07/07 16:22:30 jruoho Exp $
.\"
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -58,9 +58,7 @@
.Os
.Sh NAME
.Nm pthread_attr_init ,
-.Nm pthread_attr_destroy ,
-.Nm pthread_attr_setschedpolicy ,
-.Nm pthread_attr_getschedpolicy
+.Nm pthread_attr_destroy
.Nd thread attribute operations
.Sh LIBRARY
.Lb libpthread
@@ -70,10 +68,6 @@
.Fn pthread_attr_init "pthread_attr_t *attr"
.Ft int
.Fn pthread_attr_destroy "pthread_attr_t *attr"
-.Ft int
-.Fn pthread_attr_setschedpolicy "pthread_attr_t *attr" "int policy"
-.Ft int
-.Fn pthread_attr_getschedpolicy "const pthread_attr_t * restrict attr" "int * restrict policy"
.Sh DESCRIPTION
Thread attributes are used to specify parameters to
.Fn pthread_create .
@@ -105,7 +99,7 @@
Otherwise, an error number is returned to indicate the error.
.Sh ERRORS
.Fn pthread_attr_init
-should fail if:
+may fail if:
.Bl -tag -width Er
.It Bq Er ENOMEM
Out of memory.
@@ -119,25 +113,13 @@
.Fa attr
is invalid.
.El
-.Pp
-.Fn pthread_attr_setschedpolicy
-may fail if:
-.Bl -tag -width Er
-.It Bq Er EINVAL
-Invalid value for
-.Fa attr .
-.It Bq Er ENOTSUP
-Invalid or unsupported value for
-.Fa policy .
-.El
.Sh SEE ALSO
.Xr pthread_create 3 ,
.Xr pthread_join 3
.Sh STANDARDS
-.Fn pthread_attr_init ,
-.Fn pthread_attr_destroy ,
-.Fn pthread_attr_setschedpolicy ,
+The
+.Fn pthread_attr_init
and
-.Fn pthread_attr_getschedpolicy
-conform to
+.Fn pthread_attr_destroy
+functions conform to
.St -p1003.1-96 .
diff -r c67ded4d8bf1 -r 388db8f8c814 lib/libpthread/pthread_attr_getschedpolicy.3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libpthread/pthread_attr_getschedpolicy.3 Wed Jul 07 16:22:30 2010 +0000
@@ -0,0 +1,81 @@
+.\" $NetBSD: pthread_attr_getschedpolicy.3,v 1.1 2010/07/07 16:22:30 jruoho Exp $
+.\"
+.\" Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd July 7, 2010
+.Dt PTHREAD_ATTR_GETSCHEDPOLICY 3
+.Os
+.Sh NAME
+.Nm pthread_attr_getschedpolicy
+.Nd get and set scheduling policy attribute
+.Sh LIBRARY
+.Lb libpthread
+.Sh SYNOPSIS
+.In pthread.h
+.Ft int
+.Fn pthread_attr_getschedpolicy \
+"const pthread_attr_t * restrict attr" "int * restrict policy"
+.Ft int
+.Fn pthread_attr_setschedpolicy "pthread_attr_t *attr" "int policy"
+.Sh DESCRIPTION
+The
+.Fn pthread_attr_getschedpolicy
+and
+.Fn pthread_attr_setschedpolicy
+functions get and set the scheduling policy attribute,
+.Fa policy ,
+in the
+.Fa attr
+object.
+The supported values of
+.Fa policy
+are the same ones listed in
+.Xr pthread_schedparam 3 .
+.Sh RETURN VALUES
+If successful, both functions return 0.
+Otherwise, an error number is returned to indicate the error.
+.Sh ERRORS
+No errors are defined for
+.Fn pthread_attr_getschedpolicy .
+.Pp
+The
+.Fn pthread_attr_setschedpolicy
+function may fail if:
+.Bl -tag -width Er
+.It Bq Er ENOMEM
+There was insufficient memory.
+.It Bq Er ENOTSUP
+An unsupported
+.Fa policy
+was specified.
+.El
+.Sh SEE ALSO
+.Xr pthread_attr 3 ,
+.Xr pthread_attr_getschedparam 3 ,
+.Xr pthread_schedparam 3
+.Sh STANDARDS
+Both functions conform to
+.St -p1003.1-2008 .
Home |
Main Index |
Thread Index |
Old Index