RTEMS 6.1-rc4
|
Manage the attributes of a thread. More...
#include <thread.hpp>
Public Types | |
enum | sched_attr { sched_inherit , sched_explicit } |
enum | sched_policy { sched_other , sched_fifo , sched_roundrobin , sched_sporadic } |
Public Member Functions | |
attributes () | |
attributes (const attributes &attr) | |
void | set_name (const std::string &name) |
void | set_name (const char *name) |
const std::string & | get_name () const |
void | set_priority (int priority) |
int | get_priority () const |
void | set_stack_size (size_t size) |
size_t | get_stack_size () const |
void | set_scheduler (const std::string &scheduler) |
void | set_scheduler (const char *scheduler) |
const std::string & | get_scheduler () |
sched_attr | get_scheduler_attr () const |
void | set_scheduler_policy (sched_policy policy) |
sched_policy | get_scheduler_policy () const |
void | commit () |
void | update () |
attributes & | operator= (const attributes &attr) |
bool | operator== (const attributes &attr) const |
Manage the attributes of a thread.
rtems::thread::attributes::attributes | ( | ) |
Construct a thread attributes object with the current settings of the executing thread. The stack size is set to the configured minimum stack size.
void rtems::thread::attributes::commit | ( | ) |
Commit any changes to the executing thread.
const std::string & rtems::thread::attributes::get_name | ( | ) | const |
Get the name of the thread.
const | std::string& The name of the thread. |
int rtems::thread::attributes::get_priority | ( | ) | const |
Get the POSIX API priority of the thread.
int | The POSIX API thread priority. |
const std::string & rtems::thread::attributes::get_scheduler | ( | ) |
Get scheduler name.
attributes::sched_attr rtems::thread::attributes::get_scheduler_attr | ( | ) | const |
Get the attributes' scheduler attribute for the thread.
attributes::sched_policy rtems::thread::attributes::get_scheduler_policy | ( | ) | const |
Get the scheduler policy for the thread.
size_t rtems::thread::attributes::get_stack_size | ( | ) | const |
Get the stack size.
size_t | The stack size in bytes. |
attributes & rtems::thread::attributes::operator= | ( | const attributes & | attr | ) |
Copy operator.
bool rtems::thread::attributes::operator== | ( | const attributes & | attr | ) | const |
The comparison operator does not check the name or stack size of a thread.
void rtems::thread::attributes::set_name | ( | const char * | name | ) |
Set the name of the thread. The thread is a classic API thread and the name is only 4 characters.
name | The name as a string. |
void rtems::thread::attributes::set_name | ( | const std::string & | name | ) |
Set the name of the thread. The thread is a classic API thread and the name is only 4 characters.
name | The name as a string. |
void rtems::thread::attributes::set_priority | ( | int | priority | ) |
Set the priority of the thread.
priority | The POSIX API priority of the thread. |
void rtems::thread::attributes::set_scheduler | ( | const char * | scheduler | ) |
Set the scheduler name. If not set no scheduler is set.
void rtems::thread::attributes::set_scheduler | ( | const std::string & | scheduler | ) |
Set the scheduler name. If not set no scheduler is set.
@parrm scheduler The name of the scheduler.
void rtems::thread::attributes::set_scheduler_policy | ( | sched_policy | policy | ) |
Set the scheduler policy for the thread. This call sets the scheduler attribute to sched_explicit.
policy | The scheduler policy. |
void rtems::thread::attributes::set_stack_size | ( | size_t | size | ) |
Set the stack size. If the size is less than the configured minimum the minimum value is used.
size | The stack size in bytes. |
void rtems::thread::attributes::update | ( | ) |
Update the attribute values from the executing thread. The attributes are updated from the current thread when constructed and the values returned are those held since then. If another thread changes the attributes of the current thread those changes will not be seen until this method is called. Except for the name and stack size any local changes made will lost then the update call is made.