![]() |
Max OS 0.3
|
A wrapper for a Thread which exposes Thread operations as Resource operations. More...
#include <scheduler_resources.h>
Public Member Functions | |
| ThreadResource (const string &name, size_t flags, resource_type_t type) | |
| void | close (size_t flags) final |
| Closes the thread resource, marking the thread to be removed by the scheduler. | |
| int | read (void *buffer, size_t size, size_t flags) final |
| Reads data from the thread resource. | |
| int | write (const void *buffer, size_t size, size_t flags) final |
| Writes data to the thread resource. | |
Public Attributes | |
| Thread * | thread |
| The thread that this resource handles & exposes. | |
| uint64_t | exit_code |
| The exit code of the thread once it has exited. | |
A wrapper for a Thread which exposes Thread operations as Resource operations.
Definition at line 59 of file scheduler_resources.h.
| ThreadResource::ThreadResource | ( | const string & | name, |
| size_t | flags, | ||
| resource_type_t | type | ||
| ) |
Definition at line 179 of file scheduler_resources.cpp.
|
final |
Closes the thread resource, marking the thread to be removed by the scheduler.
| flags | N/A |
Definition at line 190 of file scheduler_resources.cpp.
References thread, and MaxOS::processes::Thread::thread_state.
|
final |
Reads data from the thread resource.
| buffer | The buffer to read into |
| size | The number of bytes to read |
| flags | The flags to pass to the reading |
Definition at line 204 of file scheduler_resources.cpp.
References exit_code, MaxOS::processes::Thread::parent_pid, thread, MaxOS::processes::Thread::thread_state, MaxOS::processes::Thread::ticks, MaxOS::processes::Thread::tid, and MaxOS::processes::Thread::wakeup_time.
|
final |
Writes data to the thread resource.
| buffer | The buffer to write from |
| size | The number of bytes to write |
| flags | The flags to pass to the writing |
Definition at line 252 of file scheduler_resources.cpp.
References MaxOS::processes::Thread::disable_port(), MaxOS::processes::Thread::enable_port(), exit_code, MaxOS::processes::Thread::sleep(), thread, MaxOS::processes::Thread::thread_state, and MaxOS::processes::Thread::yield().
| uint64_t MaxOS::processes::resources::ThreadResource::exit_code |
The exit code of the thread once it has exited.
Definition at line 66 of file scheduler_resources.h.
| Thread* MaxOS::processes::resources::ThreadResource::thread |
The thread that this resource handles & exposes.
Definition at line 65 of file scheduler_resources.h.