|
FreeRTOS:
POSIX
|
| Return to main page ↑ |
Implementation of thread functions in pthread.h. More...
#include <stddef.h>#include <string.h>#include "FreeRTOS_POSIX.h"#include "FreeRTOS_POSIX/errno.h"#include "FreeRTOS_POSIX/pthread.h"Data Structures | |
| struct | pthread_attr_internal_t |
| Thread attribute object. More... | |
| struct | pthread_internal_t |
| Thread object. More... | |
Functions | |
| static void | prvExitThread (void) |
| Terminates the calling thread. More... | |
| static void | prvRunThread (void *pxArg) |
| Wrapper function for the user's thread routine. More... | |
| int | pthread_attr_destroy (pthread_attr_t *attr) |
| Destroy the thread attributes object. More... | |
| int | pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate) |
| Get detachstate attribute. More... | |
| int | pthread_attr_getschedparam (const pthread_attr_t *attr, struct sched_param *param) |
| Get schedparam attribute. More... | |
| int | pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *stacksize) |
| Get stacksize attribute. More... | |
| int | pthread_attr_init (pthread_attr_t *attr) |
| Initialize the thread attributes object. More... | |
| int | pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) |
| Set detachstate attribute. More... | |
| int | pthread_attr_setschedparam (pthread_attr_t *attr, const struct sched_param *param) |
| Set schedparam attribute. More... | |
| int | pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy) |
| Set the schedpolicy attribute. More... | |
| int | pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize) |
| Set stacksize attribute. More... | |
| int | pthread_create (pthread_t *thread, const pthread_attr_t *attr, void *(*startroutine)(void *), void *arg) |
| Thread creation. More... | |
| int | pthread_getschedparam (pthread_t thread, int *policy, struct sched_param *param) |
| Dynamic thread scheduling parameters access. More... | |
| int | pthread_equal (pthread_t t1, pthread_t t2) |
| Compare thread IDs. More... | |
| void | pthread_exit (void *value_ptr) |
| Thread termination. More... | |
| int | pthread_join (pthread_t pthread, void **retval) |
| Wait for thread termination. More... | |
| pthread_t | pthread_self (void) |
| Get the calling thread ID. More... | |
| int | pthread_setschedparam (pthread_t thread, int policy, const struct sched_param *param) |
| Dynamic thread scheduling parameters access. More... | |
Variables | |
| static const pthread_attr_internal_t | xDefaultThreadAttributes |
| Default pthread_attr_t. More... | |
Implementation of thread functions in pthread.h.
|
static |
Terminates the calling thread.
For joinable threads, this function waits for pthread_join. Otherwise, it deletes the thread and frees up resources used by the thread.
|
static |
Wrapper function for the user's thread routine.
This function is executed as a FreeRTOS task function.
| [in] | pxArg | A pointer to a pthread_internal_t. |
| int pthread_attr_destroy | ( | pthread_attr_t * | attr | ) |
Destroy the thread attributes object.
| 0 | - Upon successful completion. |
| int pthread_attr_getdetachstate | ( | const pthread_attr_t * | attr, |
| int * | detachstate | ||
| ) |
Get detachstate attribute.
| 0 | - Upon successful completion. |
| int pthread_attr_getschedparam | ( | const pthread_attr_t * | attr, |
| struct sched_param * | param | ||
| ) |
Get schedparam attribute.
| 0 | - Upon successful completion. |
| int pthread_attr_getstacksize | ( | const pthread_attr_t * | attr, |
| size_t * | stacksize | ||
| ) |
Get stacksize attribute.
| 0 | - Upon successful completion. |
| int pthread_attr_init | ( | pthread_attr_t * | attr | ) |
Initialize the thread attributes object.
| 0 | - Upon successful completion. |
| int pthread_attr_setdetachstate | ( | pthread_attr_t * | attr, |
| int | detachstate | ||
| ) |
Set detachstate attribute.
| 0 | - Upon successful completion |
| EINVAL | - The value of detachstate is not valid. Currently, supported detach states are – PTHREAD_CREATE_DETACHED and PTHREAD_CREATE_JOINABLE. |
| int pthread_attr_setschedparam | ( | pthread_attr_t * | attr, |
| const struct sched_param * | param | ||
| ) |
Set schedparam attribute.
| 0 | - Upon successful completion. |
| EINVAL | - The value of param is not valid. |
| ENOTSUP | - An attempt was made to set the attribute to an unsupported value. |
| int pthread_attr_setschedpolicy | ( | pthread_attr_t * | attr, |
| int | policy | ||
| ) |
Set the schedpolicy attribute.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_attr_setschedpolicy.html
| 0 | - Upon successful completion. |
| int pthread_attr_setstacksize | ( | pthread_attr_t * | attr, |
| size_t | stacksize | ||
| ) |
Set stacksize attribute.
| 0 | - Upon successful completion. |
| EINVAL | - The value of stacksize is less than {PTHREAD_STACK_MIN}. |
| int pthread_create | ( | pthread_t * | thread, |
| const pthread_attr_t * | attr, | ||
| void *(*)(void *) | startroutine, | ||
| void * | arg | ||
| ) |
Thread creation.
| 0 | - Upon successful completion. |
| EAGAIN | - Insufficient memory for either thread structure or task creation. |
| int pthread_getschedparam | ( | pthread_t | thread, |
| int * | policy, | ||
| struct sched_param * | param | ||
| ) |
Dynamic thread scheduling parameters access.
| 0 | - Upon successful completion. |
Compare thread IDs.
| 0 | - t1 and t2 are both not NULL && equal. |
| non-zero | - otherwise. |
| void pthread_exit | ( | void * | value_ptr | ) |
Thread termination.
| void | - this function cannot return to its caller. |
| int pthread_join | ( | pthread_t | thread, |
| void ** | retval | ||
| ) |
Wait for thread termination.
| 0 | - Upon successful completion. |
| EDEADLK | - The value specified by the thread argument to pthread_join() does not refer to a joinable thread OR multiple simultaneous calls to pthread_join() specifying the same target thread OR the value specified by the thread argument to pthread_join() refers to the calling thread. |
| pthread_t pthread_self | ( | void | ) |
Get the calling thread ID.
| the | thread ID of the calling thread. |
| int pthread_setschedparam | ( | pthread_t | thread, |
| int | policy, | ||
| const struct sched_param * | param | ||
| ) |
Dynamic thread scheduling parameters access.
| 0 | - Upon successful completion. |
|
static |
Default pthread_attr_t.