![]() |
Max OS 0.3
|
Manages the creation, retention and destruction of resources representing threads. More...
#include <scheduler_resources.h>
Public Member Functions | |
| Resource * | get_resource (const string &name) final |
| Gets a resource from the registry by name. | |
| Resource * | create_resource (const string &name, size_t flags, uintptr_t data) final |
| td | |
Public Member Functions inherited from MaxOS::processes::resources::ResourceRegistry< ThreadResource > | |
| ResourceRegistry (resource_type_t type) | |
| Constructor for ResourceRegistry of a specific type. | |
Public Member Functions inherited from MaxOS::processes::resources::BaseResourceRegistry | |
| BaseResourceRegistry (resource_type_t type) | |
| Constructs a new BaseResourceRegistry object and registers it globally. | |
| ~BaseResourceRegistry () | |
| Destructor for BaseResourceRegistry, removes it from the global list. | |
| resource_type_t | type () |
| Gets the type of resources this registry handles. | |
| bool | register_resource (Resource *resource) |
| Registers a resource in the registry. | |
| void | close_resource (Resource *resource, size_t flags) |
| Close the resource provided, if it exists in this registry. | |
Additional Inherited Members | |
Protected Attributes inherited from MaxOS::processes::resources::BaseResourceRegistry | |
| common::Map< string, Resource * > | m_resources |
| The map of resource names to resource instances. | |
| common::Map< string, uint64_t > | m_resource_uses |
| The map of resource names to how many processes are using them. | |
| common::Spinlock | m_lock |
| The lock to make the registry threadsafe. | |
| resource_type_t | m_type |
| The resource type that this registry manages. | |
Manages the creation, retention and destruction of resources representing threads.
Definition at line 79 of file scheduler_resources.h.
| ThreadResourceRegistry::ThreadResourceRegistry | ( | ) |
Definition at line 302 of file scheduler_resources.cpp.
|
finalvirtual |
td
| name | td |
| flags | td |
Reimplemented from MaxOS::processes::resources::ResourceRegistry< ThreadResource >.
Definition at line 316 of file scheduler_resources.cpp.
References MaxOS::processes::resources::ResourceRegistry< Type >::create_resource().
|
finalvirtual |
Gets a resource from the registry by name.
| name | The name of the resource to find |
Reimplemented from MaxOS::processes::resources::BaseResourceRegistry.
Definition at line 321 of file scheduler_resources.cpp.
References MaxOS::processes::GlobalScheduler::current_thread(), MaxOS::processes::resources::BaseResourceRegistry::get_resource(), MaxOS::processes::GlobalScheduler::get_thread(), and MaxOS::processes::resources::BaseResourceRegistry::register_resource().