pthread_threading_attr.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 RenĂ© Kijewski <rene.kijewski@fu-berlin.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
17 #ifndef PTHREAD_THREADING_ATTR_H
18 #define PTHREAD_THREADING_ATTR_H
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
29 typedef struct
30 {
31  uint8_t detached;
32  char *ss_sp;
33  size_t ss_size;
35 
39 struct sched_param {
41  int todo; /* TODO */
42 };
43 
44 #define PTHREAD_CREATE_JOINABLE (0)
45 #define PTHREAD_CREATE_DETACHED (1)
54 int pthread_attr_init(pthread_attr_t *attr);
55 
62 
69 int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate);
70 
80 int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate);
81 
88 int pthread_attr_getguardsize(const pthread_attr_t *attr, size_t *guardsize);
89 
96 int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize);
97 
104 int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *param);
105 
112 int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param);
113 
120 int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy);
121 
128 int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
129 
136 int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inherit);
137 
144 int pthread_attr_setinheritsched(pthread_attr_t *attr, int inherit);
145 
152 int pthread_attr_getscope(const pthread_attr_t *attr, int *scope);
153 
160 int pthread_attr_setscope(pthread_attr_t *attr, int scope);
161 
169 int pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr);
170 
182 int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr);
183 
191 int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize);
192 
203 int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize);
204 
205 #ifdef __cplusplus
206 }
207 #endif
208 
209 #endif /* PTHREAD_THREADING_ATTR_H */
210 
pthread_attr_setstacksize
int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize)
Set the stack size for the new pthread.
pthread_attr_setschedpolicy
int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
This function is unused right now, and only exists for POSIX compatibility.
pthread_attr_setscope
int pthread_attr_setscope(pthread_attr_t *attr, int scope)
This function is unused right now, and only exists for POSIX compatibility.
pthread_attr_setdetachstate
int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate)
Sets whether to create a new pthread in a detached state.
pthread_attr_setstackaddr
int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr)
Set address of the stack to use for the new pthread.
pthread_attr_t::ss_size
size_t ss_size
Size of dynamically allocated stack, or supplied stack, resp.
Definition: pthread_threading_attr.h:33
pthread_attr_t
An attribute set to supply to pthread_create()
Definition: pthread_threading_attr.h:29
pthread_attr_getschedpolicy
int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy)
This function is unused right now, and only exists for POSIX compatibility.
pthread_attr_setschedparam
int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param)
This function is unused right now, and only exists for POSIX compatibility.
pthread_attr_getscope
int pthread_attr_getscope(const pthread_attr_t *attr, int *scope)
This function is unused right now, and only exists for POSIX compatibility.
sched_param
This structure is unused right now, and only exists for POSIX compatibility.
Definition: pthread_threading_attr.h:39
pthread_attr_setinheritsched
int pthread_attr_setinheritsched(pthread_attr_t *attr, int inherit)
This function is unused right now, and only exists for POSIX compatibility.
pthread_attr_getinheritsched
int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inherit)
This function is unused right now, and only exists for POSIX compatibility.
pthread_attr_getdetachstate
int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate)
Tells whether to create a new pthread in a detached state.
pthread_attr_getguardsize
int pthread_attr_getguardsize(const pthread_attr_t *attr, size_t *guardsize)
This function is unused right now, and only exists for POSIX compatibility.
pthread_attr_destroy
int pthread_attr_destroy(pthread_attr_t *attr)
Destroys an attribute set.
pthread_attr_t::ss_sp
char * ss_sp
Stack to use for new thread.
Definition: pthread_threading_attr.h:32
pthread_attr_setguardsize
int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize)
This function is unused right now, and only exists for POSIX compatibility.
pthread_attr_getstackaddr
int pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr)
Query assigned stack for new pthread.
pthread_attr_getstacksize
int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize)
Query set stacksize for new pthread.
pthread_attr_getschedparam
int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *param)
This function is unused right now, and only exists for POSIX compatibility.
sched_param::todo
int todo
Todo is the greates magician in the land of RIOT.
Definition: pthread_threading_attr.h:41
pthread_attr_t::detached
uint8_t detached
Start in detached state.
Definition: pthread_threading_attr.h:31