Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpthread Add pthread_{g, s}etschedparam, that do nothing.



details:   https://anonhg.NetBSD.org/src/rev/35acf523a36f
branches:  trunk
changeset: 556122:35acf523a36f
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Dec 07 20:29:07 2003 +0000

description:
Add pthread_{g,s}etschedparam, that do nothing.

diffstat:

 lib/libpthread/pthread.h     |   5 ++++-
 lib/libpthread/pthread_run.c |  29 +++++++++++++++++++++++++++--
 2 files changed, 31 insertions(+), 3 deletions(-)

diffs (68 lines):

diff -r 5510485600ec -r 35acf523a36f lib/libpthread/pthread.h
--- a/lib/libpthread/pthread.h  Sun Dec 07 20:22:49 2003 +0000
+++ b/lib/libpthread/pthread.h  Sun Dec 07 20:29:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread.h,v 1.15 2003/11/09 18:56:48 christos Exp $    */
+/*     $NetBSD: pthread.h,v 1.16 2003/12/07 20:29:07 christos Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -167,6 +167,9 @@
 int    pthread_barrierattr_init(pthread_barrierattr_t *);
 int    pthread_barrierattr_destroy(pthread_barrierattr_t *);
 
+int    pthread_getschedparam(pthread_t, int *, struct sched_param *);
+int    pthread_setschedparam(pthread_t, int, const struct sched_param *);
+
 int    *pthread__errno(void);
 __END_DECLS
 
diff -r 5510485600ec -r 35acf523a36f lib/libpthread/pthread_run.c
--- a/lib/libpthread/pthread_run.c      Sun Dec 07 20:22:49 2003 +0000
+++ b/lib/libpthread/pthread_run.c      Sun Dec 07 20:29:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_run.c,v 1.13 2003/11/09 18:56:48 christos Exp $        */
+/*     $NetBSD: pthread_run.c,v 1.14 2003/12/07 20:29:07 christos Exp $        */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,9 +37,10 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_run.c,v 1.13 2003/11/09 18:56:48 christos Exp $");
+__RCSID("$NetBSD: pthread_run.c,v 1.14 2003/12/07 20:29:07 christos Exp $");
 
 #include <ucontext.h>
+#include <errno.h>
 
 #include "pthread.h"
 #include "pthread_int.h"
@@ -278,3 +279,27 @@
        }
        pthread_spinunlock(self, &pthread__runqueue_lock);
 }
+
+
+/*ARGSUSED*/
+int
+pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param)
+{
+       if (param == NULL || policy == NULL)
+               return EINVAL;
+       param->sched_priority = 0;
+       *policy = SCHED_RR;
+       return 0;
+}
+
+/*ARGSUSED*/
+int
+pthread_setschedparam(pthread_t thread, int policy, 
+    const struct sched_param *param)
+{
+       if (param == NULL || policy < SCHED_FIFO || policy > SCHED_RR)
+               return EINVAL;
+       if (param->sched_priority > 0 || policy != SCHED_RR)
+               return ENOTSUP;
+       return 0;
+}



Home | Main Index | Thread Index | Old Index