BEEP-8 SDK 1.0.0
|
Header file for POSIX thread (pthread) functions. More...
Go to the source code of this file.
Classes | |
struct | _b8_pthread_attr_t |
Macros | |
#define | pthread_attr_t b8_pthread_attr_t |
#define | PTHREAD_STACK_MIN (0x200) |
#define | PTHREAD_CREATE_JOINABLE 0 |
#define | PTHREAD_CREATE_DETACHED 1 |
#define | pthread_equal(t1, t2) |
Typedefs | |
typedef b8OsPid | pthread_t |
typedef void * | pthread_addr_t |
typedef pthread_addr_t(* | pthread_startroutine_t) (pthread_addr_t) |
typedef pthread_startroutine_t | pthread_func_t |
typedef struct _b8_pthread_attr_t | b8_pthread_attr_t |
Functions | |
int | pthread_create (pthread_t *thread, const pthread_attr_t *attr, pthread_startroutine_t startroutine, pthread_addr_t arg) |
Creates a new thread. | |
int | pthread_yield (void) |
Yields the processor to another thread. | |
pthread_t | pthread_self (void) |
Returns the thread identifier of the calling thread. | |
int | pthread_attr_init (pthread_attr_t *attr) |
Initializes a thread attributes object. | |
int | pthread_attr_destroy (pthread_attr_t *attr) |
Destroys a thread attributes object. | |
int | pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize) |
Sets the stack size attribute in the thread attributes object. | |
int | pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *stacksize) |
Gets the stack size attribute from the thread attributes object. | |
int | pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, long stacksize) |
Sets the stack address and size attributes in the thread attributes object. | |
int | pthread_attr_getstack (const pthread_attr_t *attr, void **stackaddr, long *stacksize) |
Gets the stack address and size attributes from the thread attributes object. | |
int | pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate) |
Gets the detach state attribute from the thread attributes object. | |
int | pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) |
Sets the detach state attribute in the thread attributes object. | |
int | pthread_attr_setschedparam (pthread_attr_t *attr, const struct sched_param *param) |
Sets the scheduling parameters in the thread attributes object. | |
int | pthread_attr_getschedparam (const pthread_attr_t *attr, struct sched_param *param) |
Retrieves the scheduling parameters from the thread attributes object. | |
int | pthread_getschedparam (pthread_t thread, int *policy, struct sched_param *param) |
Retrieves the scheduling policy and parameters of the specified thread. | |
int | pthread_setschedparam (pthread_t thread, int policy, const struct sched_param *param) |
Sets the scheduling policy and parameters of the specified thread. | |
int | pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy) |
Sets the scheduling policy attribute in the thread attributes object. | |
int | pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *policy) |
Retrieves the scheduling policy from the thread attributes object. | |
void | pthread_exit (pthread_addr_t value) |
Terminates the calling thread. | |
int | pthread_detach (pthread_t thread) |
Detaches the specified thread. | |
int | pthread_join (pthread_t thread, pthread_addr_t *value) |
Waits for the specified thread to terminate. | |
int | pthread_cancel (pthread_t thread) |
Cancels the specified thread. | |
int | pthread_setcanceltype (int type, int *oldtype) |
Sets the cancelability type of the calling thread. | |
void | pthread_testcancel (void) |
Creates a cancellation point in the calling thread. | |
Header file for POSIX thread (pthread) functions.
This header file provides the declarations for various POSIX thread (pthread) functions. It includes functions for creating and managing threads, setting and getting thread attributes, and handling thread scheduling and synchronization. The functionality of these functions varies based on the specific OS environment.
#define pthread_equal | ( | t1, | |
t2 ) |
|
extern |
Destroys a thread attributes object.
This function is part of the POSIX standard and is used to destroy a thread attributes object, freeing any resources it may hold. This function works correctly in this OS environment.
attr | A pointer to the thread attributes object to be destroyed. |
|
extern |
Gets the detach state attribute from the thread attributes object.
This function is part of the POSIX standard and is used to retrieve the detach state attribute from a thread attributes object. This function works correctly in this OS environment.
attr | A pointer to the thread attributes object. |
detachstate | A pointer to a variable where the detach state will be stored. |
|
extern |
Retrieves the scheduling parameters from the thread attributes object.
This function is part of the POSIX standard and allows retrieving the scheduling parameters from the thread attributes object. However, in this specific OS environment, while the function can be called and the parameters can be retrieved, the actual scheduling policy is ignored, making it effectively unsupported.
attr | A pointer to the thread attributes object. |
param | A pointer to a struct sched_param where the scheduling parameters will be stored. |
|
extern |
Retrieves the scheduling policy from the thread attributes object.
This function is part of the POSIX standard. In this specific environment, while the function can be called and the policy can be retrieved, the actual scheduling policy is ignored and thus effectively unsupported.
attr | A pointer to the thread attributes object. |
policy | A pointer to an integer where the policy will be stored. |
|
extern |
Gets the stack address and size attributes from the thread attributes object.
This function is part of the POSIX standard and is used to retrieve the stack address and size attributes from a thread attributes object. This function works correctly in this OS environment.
attr | A pointer to the thread attributes object. |
stackaddr | A pointer to a variable where the stack address will be stored. |
stacksize | A pointer to a variable where the stack size will be stored. |
|
extern |
Gets the stack size attribute from the thread attributes object.
This function is part of the POSIX standard and is used to retrieve the stack size attribute from a thread attributes object. This function works correctly in this OS environment.
attr | A pointer to the thread attributes object. |
stacksize | A pointer to a variable where the stack size will be stored. |
|
extern |
Initializes a thread attributes object.
This function is part of the POSIX standard and is used to initialize a thread attributes object with default values. This function works correctly in this OS environment.
attr | A pointer to the thread attributes object to be initialized. |
|
extern |
Sets the detach state attribute in the thread attributes object.
This function is part of the POSIX standard and is used to set the detach state attribute in a thread attributes object. This function works correctly in this OS environment.
attr | A pointer to the thread attributes object. |
detachstate | The detach state to be set. |
|
extern |
Sets the scheduling parameters in the thread attributes object.
This function is part of the POSIX standard and allows setting the scheduling parameters in the thread attributes object. However, in this specific OS environment, while the function can be called and the parameters can be set, the actual scheduling policy is ignored, making it effectively unsupported.
attr | A pointer to the thread attributes object. |
param | A pointer to a struct sched_param containing the scheduling parameters. |
|
extern |
Sets the scheduling policy attribute in the thread attributes object.
This function is part of the POSIX standard. In this specific environment, while the function can be called and the policy can be set, the actual scheduling policy is ignored and thus effectively unsupported.
attr | A pointer to the thread attributes object. |
policy | The new scheduling policy. |
|
extern |
Sets the stack address and size attributes in the thread attributes object.
This function is part of the POSIX standard and is used to set the stack address and size attributes in a thread attributes object. This function works correctly in this OS environment.
attr | A pointer to the thread attributes object. |
stackaddr | The stack address to be set. |
stacksize | The stack size to be set. |
|
extern |
Sets the stack size attribute in the thread attributes object.
This function is part of the POSIX standard and is used to set the stack size attribute in a thread attributes object. This function works correctly in this OS environment.
attr | A pointer to the thread attributes object. |
stacksize | The stack size to be set. |
|
extern |
Cancels the specified thread.
This function is part of the POSIX standard and is used to request the cancellation of a thread. However, in this OS environment, this function is not supported and always returns -ERRNOSYS.
thread | The thread to be canceled. |
|
extern |
Creates a new thread.
This function is part of the POSIX standard and is used to create a new thread. It initializes a new thread and makes it executable, running the specified start routine with the given argument. This function works correctly in this OS environment.
thread | A pointer to the thread identifier that will be returned. |
attr | A pointer to the thread attributes object that specifies attributes for the new thread. If NULL, default attributes are used. |
startroutine | The routine that the new thread will execute. |
arg | The argument passed to the start routine. |
|
extern |
Detaches the specified thread.
This function is part of the POSIX standard and is used to detach a thread, allowing its resources to be automatically reclaimed upon termination. However, in this OS environment, this function is not supported and always returns -ERRNOSYS.
thread | The thread to be detached. |
|
extern |
Terminates the calling thread.
This function is part of the POSIX standard and allows for the termination of the calling thread. However, in this specific OS environment, thread termination is not supported. While the function can be called, it will only put the thread into an indefinite wait state, and the thread will not be released or cleaned up.
value | The exit status of the thread. |
|
extern |
Retrieves the scheduling policy and parameters of the specified thread.
This function is part of the POSIX standard. However, in this specific environment, it is not supported and will always return -ERRNOSYS.
thread | The thread whose scheduling parameters are to be retrieved. |
policy | A pointer to an integer where the policy will be stored. |
param | A pointer to a struct sched_param where the scheduling parameters will be stored. |
|
extern |
Waits for the specified thread to terminate.
This function is part of the POSIX standard and is used to wait for a thread to terminate and optionally retrieve its exit status. However, in this OS environment, this function is not supported and always returns -ERRNOSYS.
thread | The thread to wait for. |
value | A pointer to a location where the exit status of the thread will be stored. |
|
extern |
Returns the thread identifier of the calling thread.
This function is part of the POSIX standard and is used to obtain the thread identifier of the calling thread. This function works correctly in this OS environment.
|
extern |
Sets the cancelability type of the calling thread.
This function is part of the POSIX standard and is used to set the cancelability type (deferred or asynchronous) of the calling thread. However, in this OS environment, this function is not supported and always returns -ERRNOSYS.
type | The new cancelability type. |
oldtype | A pointer to an integer where the previous cancelability type will be stored. |
|
extern |
Sets the scheduling policy and parameters of the specified thread.
This function is part of the POSIX standard. However, in this specific environment, it is not supported and will always return -ERRNOSYS.
thread | The thread whose scheduling parameters are to be set. |
policy | The new scheduling policy. |
param | A pointer to a struct sched_param containing the new scheduling parameters. |
|
extern |
Creates a cancellation point in the calling thread.
This function is part of the POSIX standard and is used to create a cancellation point in the calling thread, allowing it to be canceled if a cancellation request is pending. However, in this OS environment, this function is not supported and does not perform any action.
|
extern |
Yields the processor to another thread.
This function is part of the POSIX standard and is used to yield the processor from the calling thread to another thread, allowing other threads to run. This function works correctly in this OS environment.