aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/internal/include/bits/threads.h
blob: 3feb4c34b2bfc8f6b7b6c81806a90dbf045e7ddc (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
#ifndef _INTERNAL_THREADS_H
#define _INTERNAL_THREADS_H

#include <abi-bits/clockid_t.h>
#include <bits/size_t.h>
#include <bits/cpu_set.h>
#include <bits/sigset_t.h>

// values for pthread_attr_{get,set}detachstate().
#define __MLIBC_THREAD_CREATE_JOINABLE 0
#define __MLIBC_THREAD_CREATE_DETACHED 1

// values for pthread_mutexattr_{get,set}type().
#define __MLIBC_THREAD_MUTEX_DEFAULT 0
#define __MLIBC_THREAD_MUTEX_NORMAL 0
#define __MLIBC_THREAD_MUTEX_ERRORCHECK 1
#define __MLIBC_THREAD_MUTEX_RECURSIVE 2

// values for pthread_mutexattr_{get,set}pshared().
#define __MLIBC_THREAD_PROCESS_PRIVATE 0
#define __MLIBC_THREAD_PROCESS_SHARED 1

// values for pthread_mutexattr_{get,set}robust().
#define __MLIBC_THREAD_MUTEX_STALLED 0
#define __MLIBC_THREAD_MUTEX_ROBUST 1

// Values for pthread_mutexattr_{get,set}protocol()
#define __MLIBC_THREAD_PRIO_NONE 0
#define __MLIBC_THREAD_PRIO_INHERIT 1
#define __MLIBC_THREAD_PRIO_PROTECT 2

struct sched_param {
	int sched_priority;
};

struct __mlibc_thread_data;

struct __mlibc_threadattr {
	size_t __mlibc_guardsize;
	size_t __mlibc_stacksize;
	void *__mlibc_stackaddr;
	int __mlibc_detachstate;
	int __mlibc_scope;
	int __mlibc_inheritsched;
	struct sched_param __mlibc_schedparam;
	int __mlibc_schedpolicy;
	cpu_set_t *__mlibc_cpuset;
	size_t __mlibc_cpusetsize;
	sigset_t __mlibc_sigmask;
	int __mlibc_sigmaskset;
};

struct __mlibc_mutex {
	unsigned int __mlibc_state;
	unsigned int __mlibc_recursion;
	unsigned int __mlibc_flags;
	int __mlibc_prioceiling;
};

struct __mlibc_mutexattr {
	int __mlibc_type;
	int __mlibc_robust;
	int __mlibc_protocol;
	int __mlibc_pshared;
	int __mlibc_prioceiling;
};

struct __mlibc_cond {
	unsigned int __mlibc_seq;
	unsigned int __mlibc_flags;
	clockid_t __mlibc_clock;
};

struct __mlibc_condattr {
	int __mlibc_pshared;
	clockid_t __mlibc_clock;
};

#endif /* _INTERNAL_THREADS_H */