Deleted Added
full compact
thr_setschedparam.c (113661) thr_setschedparam.c (113786)
1/*
2 * Copyright (c) 1998 Daniel Eischen <eischen@vigrid.com>.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
1/*
2 * Copyright (c) 1998 Daniel Eischen <eischen@vigrid.com>.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/lib/libkse/thread/thr_setschedparam.c 113661 2003-04-18 07:09:43Z deischen $
32 * $FreeBSD: head/lib/libkse/thread/thr_setschedparam.c 113786 2003-04-21 04:02:56Z deischen $
33 */
34#include <errno.h>
35#include <sys/param.h>
36#include <pthread.h>
37#include "thr_private.h"
38
39__weak_reference(_pthread_setschedparam, pthread_setschedparam);
40

--- 25 unchanged lines hidden (view full) ---

66 THR_SCHED_LOCK(curthread, pthread);
67 if ((pthread->state == PS_DEAD) ||
68 (pthread->state == PS_DEADLOCK) ||
69 ((pthread->flags & THR_FLAGS_EXITING) != 0)) {
70 THR_SCHED_UNLOCK(curthread, pthread);
71 _thr_ref_delete(curthread, pthread);
72 return (ESRCH);
73 }
33 */
34#include <errno.h>
35#include <sys/param.h>
36#include <pthread.h>
37#include "thr_private.h"
38
39__weak_reference(_pthread_setschedparam, pthread_setschedparam);
40

--- 25 unchanged lines hidden (view full) ---

66 THR_SCHED_LOCK(curthread, pthread);
67 if ((pthread->state == PS_DEAD) ||
68 (pthread->state == PS_DEADLOCK) ||
69 ((pthread->flags & THR_FLAGS_EXITING) != 0)) {
70 THR_SCHED_UNLOCK(curthread, pthread);
71 _thr_ref_delete(curthread, pthread);
72 return (ESRCH);
73 }
74 in_syncq = pthread->flags & THR_FLAGS_IN_SYNCQ;
74 in_syncq = pthread->sflags & THR_FLAGS_IN_SYNCQ;
75
76 /* Set the scheduling policy: */
77 pthread->attr.sched_policy = policy;
78
79 if (param->sched_priority ==
80 THR_BASE_PRIORITY(pthread->base_priority))
81 /*
82 * There is nothing to do; unlock the threads

--- 54 unchanged lines hidden ---
75
76 /* Set the scheduling policy: */
77 pthread->attr.sched_policy = policy;
78
79 if (param->sched_priority ==
80 THR_BASE_PRIORITY(pthread->base_priority))
81 /*
82 * There is nothing to do; unlock the threads

--- 54 unchanged lines hidden ---