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 
9 #pragma once
10 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
28 typedef struct
29 {
30  uint8_t detached;
31  char *ss_sp;
32  size_t ss_size;
34 
38 struct sched_param {
40  int todo; /* TODO */
41 };
42 
43 #define PTHREAD_CREATE_JOINABLE (0)
44 #define PTHREAD_CREATE_DETACHED (1)
54 
61 
68 int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate);
69 
79 int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate);
80 
87 int pthread_attr_getguardsize(const pthread_attr_t *attr, size_t *guardsize);
88 
95 int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize);
96 
103 int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *param);
104 
111 int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param);
112 
119 int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy);
120 
128 
135 int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inherit);
136 
144 
151 int pthread_attr_getscope(const pthread_attr_t *attr, int *scope);
152 
159 int pthread_attr_setscope(pthread_attr_t *attr, int scope);
160 
168 int pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr);
169 
181 int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr);
182 
190 int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize);
191 
202 int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize);
203 
211 int pthread_attr_getstack(pthread_attr_t *attr, void **stackaddr, size_t *stacksize);
212 
229 int pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr, size_t stacksize);
230 
231 #ifdef __cplusplus
232 }
233 #endif
234 
int pthread_attr_init(pthread_attr_t *attr)
Initialize attributes for a new pthread.
int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inherit)
This function is unused right now, and only exists for POSIX compatibility.
int pthread_attr_setscope(pthread_attr_t *attr, int scope)
This function is unused right now, and only exists for POSIX compatibility.
int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr)
Set address of the stack to use for the new pthread.
int pthread_attr_setinheritsched(pthread_attr_t *attr, int inherit)
This function is unused right now, and only exists for POSIX compatibility.
int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate)
Tells whether to create a new pthread in a detached state.
int pthread_attr_destroy(pthread_attr_t *attr)
Destroys an attribute set.
int pthread_attr_getstack(pthread_attr_t *attr, void **stackaddr, size_t *stacksize)
Query set stacksize for new pthread.
int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize)
This function is unused right now, and only exists for POSIX compatibility.
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.
int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
This function is unused right now, and only exists for POSIX compatibility.
int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize)
Set the stack size for the new pthread.
int pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr, size_t stacksize)
Set address and stack size of the stack to use for the new pthread.
int pthread_attr_getguardsize(const pthread_attr_t *attr, size_t *guardsize)
This function is unused right now, and only exists for POSIX compatibility.
int pthread_attr_getscope(const pthread_attr_t *attr, int *scope)
This function is unused right now, and only exists for POSIX compatibility.
int pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr)
Query assigned stack for new pthread.
int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize)
Query set stacksize for new pthread.
int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate)
Sets whether to create a new pthread in a detached state.
int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy)
This function is unused right now, and only exists for POSIX compatibility.
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.
An attribute set to supply to pthread_create()
uint8_t detached
Start in detached state.
size_t ss_size
Size of dynamically allocated stack, or supplied stack, resp.
char * ss_sp
Stack to use for new thread.
This structure is unused right now, and only exists for POSIX compatibility.
int todo
Todo is the greates magician in the land of RIOT.