summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/thread.h
blob: 355967bb1a8c730a18d4ef63b0301268bf505d35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* Copyright (C) 2008 Free Software Foundation, Inc.
   This file is part of the GNU C Library.
   Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

#ifndef _THREAD_H
#define _THREAD_H

#include <signal.h>
#include <synch.h>

typedef unsigned int thread_t;
typedef unsigned int thread_key_t;

#define THR_BOUND	0x00000001 /* PTHREAD_SCOPE_SYSTEM; unused */
#define THR_NEW_LWP	0x00000002 /* unused */
#define THR_DETACHED	0x00000040 /* PTHREAD_CREATE_DETACHED */
#define THR_SUSPENDED	0x00000080
#define THR_DAEMON	0x00000100

#define THR_ONCE_KEY	(thread_key_t)(-1)

#define TRS_VALID	0
#define TRS_NONVOLATILE	1
#define TRS_LWPID	2
#define TRS_INVALID	3

__BEGIN_DECLS

extern int thr_create (void *, size_t, void * (*)(void *), void *, long,
    thread_t *);

extern int thr_join (thread_t, thread_t *, void **);

extern int thr_setconcurrency (int);

extern int thr_getconcurrency (void);

extern void thr_exit (void *);

extern thread_t thr_self (void);

extern int thr_main (void);

extern int thr_kill (thread_t, int);

extern int thr_suspend (thread_t);

extern int thr_continue (thread_t);

extern void thr_yield (void);

extern int thr_setprio (thread_t, int);

extern int thr_getprio (thread_t, int *);

extern int thr_keycreate (thread_key_t *, void(*)(void *));

extern int thr_keycreate_once (thread_key_t *, void(*)(void *));

extern int thr_setspecific (thread_key_t, void *);

extern int thr_getspecific (thread_key_t, void **);

extern int thr_sigsetmask (int how, const sigset_t *set, sigset_t *oset);

extern int thr_stksegment (stack_t *stk);

__END_DECLS

#endif /* _THREAD_H */