Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Thread Class Reference
#include <Thread.h>
Public Member Functions | |
| Thread (void(*task)(void const *argument), void *argument=NULL, osPriority priority=osPriorityNormal, uint32_t stacksize=DEFAULT_STACK_SIZE) | |
| osStatus | terminate () |
| osStatus | set_priority (osPriority priority) |
| osPriority | get_priority () |
| int32_t | signal_set (int32_t signals) |
Static Public Member Functions | |
| static osEvent | signal_wait (int32_t signals, uint32_t millisec=osWaitForever) |
| static osStatus | wait (uint32_t millisec) |
| static osStatus | yield () |
| static osThreadId | gettid () |
Detailed Description
The Thread class allow defining, creating, and controlling thread functions in the system.
Definition at line 11 of file Thread.h.
Constructor & Destructor Documentation
| Thread | ( | void(*)(void const *argument) | task, |
| void * | argument = NULL, |
||
| osPriority | priority = osPriorityNormal, |
||
| uint32_t | stacksize = DEFAULT_STACK_SIZE |
||
| ) |
Create a new thread, and start it executing the specified function.
- Parameters:
-
task function to be executed by this thread. argument pointer that is passed to the thread function as start argument. (default: NULL). priority initial priority of the thread function. (default: osPriorityNormal). stacksz stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
Member Function Documentation
| osPriority get_priority | ( | ) |
Get priority of an active thread \ return current priority value of the thread function.
| static osThreadId gettid | ( | ) | [static] |
Get the thread id of the current running thread.
- Returns:
- thread ID for reference by other functions or NULL in case of error.
| osStatus set_priority | ( | osPriority | priority ) |
Set priority of an active thread
- Parameters:
-
priority new priority value for the thread function.
- Returns:
- status code that indicates the execution status of the function.
| int32_t signal_set | ( | int32_t | signals ) |
Set the specified Signal Flags of an active thread.
- Parameters:
-
signals specifies the signal flags of the thread that should be set.
- Returns:
- previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
| static osEvent signal_wait | ( | int32_t | signals, |
| uint32_t | millisec = osWaitForever |
||
| ) | [static] |
Wait for one or more Signal Flags to become signaled for the current RUNNING thread.
- Parameters:
-
signals wait until all specified signal flags set or 0 for any single signal flag. millisec timeout value or 0 in case of no time-out. (default: osWaitForever).
- Returns:
- event flag information or error code.
| osStatus terminate | ( | ) |
Terminate execution of a thread and remove it from Active Threads
- Returns:
- status code that indicates the execution status of the function.
| static osStatus wait | ( | uint32_t | millisec ) | [static] |
Wait for a specified time period in millisec:
- Parameters:
-
millisec time delay value
- Returns:
- status code that indicates the execution status of the function.
| static osStatus yield | ( | ) | [static] |
Pass control to next thread that is in state READY.
- Returns:
- status code that indicates the execution status of the function.
Generated on Tue Jul 12 2022 17:50:57 by
1.7.2