Deleted Added
full compact
sigev_thread.c (156136) sigev_thread.c (156142)
1/*
2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
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

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

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
1/*
2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
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

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

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/lib/librt/sigev_thread.c 156136 2006-03-01 06:37:34Z davidxu $
26 * $FreeBSD: head/lib/librt/sigev_thread.c 156142 2006-03-01 08:50:36Z davidxu $
27 *
28 */
29
30#include <sys/types.h>
31#include <machine/atomic.h>
32
33#include "namespace.h"
34#include <err.h>

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

57
58static void __sigev_fork_prepare(void);
59static void __sigev_fork_parent(void);
60static void __sigev_fork_child(void);
61static struct sigev_thread_node *sigev_thread_create(pthread_attr_t *);
62static void *sigev_service_loop(void *);
63
64#pragma weak pthread_create
27 *
28 */
29
30#include <sys/types.h>
31#include <machine/atomic.h>
32
33#include "namespace.h"
34#include <err.h>

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

57
58static void __sigev_fork_prepare(void);
59static void __sigev_fork_parent(void);
60static void __sigev_fork_child(void);
61static struct sigev_thread_node *sigev_thread_create(pthread_attr_t *);
62static void *sigev_service_loop(void *);
63
64#pragma weak pthread_create
65#pragma weak pthread_attr_getschedpolicy
66#pragma weak pthread_attr_getinheritsched
67#pragma weak pthread_attr_getschedparam
68#pragma weak pthread_attr_getscope
69#pragma weak pthread_attr_getstacksize
70#pragma weak pthread_attr_getstackaddr
71#pragma weak pthread_attr_getguardsize
72#pragma weak pthread_attr_init
73#pragma weak pthread_attr_setscope
74#pragma weak pthread_attr_setdetachstate
75#pragma weak pthread_atfork
76#pragma weak _pthread_once
77#pragma weak pthread_cleanup_push
78#pragma weak pthread_cleanup_pop
79#pragma weak pthread_setcancelstate
65
80
66__weak_reference(__sigev_stub_zero, pthread_attr_getschedpolicy);
67__weak_reference(__sigev_stub_zero, pthread_attr_getinheritsched);
68__weak_reference(__sigev_stub_zero, pthread_attr_getschedparam);
69__weak_reference(__sigev_stub_zero, pthread_attr_getscope);
70__weak_reference(__sigev_stub_zero, pthread_attr_getstacksize);
71__weak_reference(__sigev_stub_zero, pthread_attr_getstackaddr);
72__weak_reference(__sigev_stub_zero, pthread_attr_getguardsize);
73__weak_reference(__sigev_stub_zero, pthread_attr_init);
74__weak_reference(__sigev_stub_zero, pthread_attr_setscope);
75__weak_reference(__sigev_stub_zero, pthread_attr_setdetachstate);
76__weak_reference(__sigev_stub_zero, pthread_atfork);
77__weak_reference(__sigev_stub_zero, _pthread_once);
78__weak_reference(__sigev_stub_zero, pthread_cleanup_push);
79__weak_reference(__sigev_stub_zero, pthread_cleanup_pop);
80__weak_reference(__sigev_stub_zero, pthread_setcancelstate);
81
82int
83__sigev_stub_zero(void)
84{
85 return (0);
86}
87
88static __inline void
89attr2sna(pthread_attr_t *attr, struct sigev_thread_attr *sna)
90{
91 struct sched_param sched_param;
92
93 pthread_attr_getschedpolicy(attr, &sna->sna_policy);
94 pthread_attr_getinheritsched(attr, &sna->sna_inherit);
95 pthread_attr_getschedparam(attr, &sched_param);

--- 338 unchanged lines hidden ---
81static __inline void
82attr2sna(pthread_attr_t *attr, struct sigev_thread_attr *sna)
83{
84 struct sched_param sched_param;
85
86 pthread_attr_getschedpolicy(attr, &sna->sna_policy);
87 pthread_attr_getinheritsched(attr, &sna->sna_inherit);
88 pthread_attr_getschedparam(attr, &sched_param);

--- 338 unchanged lines hidden ---