![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include "resource_manager.h"#include "utils/lock_guard.h"#include <algorithm>#include <map>#include <stdexcept>#include <string>#include <typeinfo>#include <utility>
Go to the source code of this file.
Classes | |
| class | lock |
| class | no_opts |
| class | options_t |
| class | resource |
| class | resource_manager_t |
| class | shm |
| class | shm_opts |
| class | singleton |
| class | singleton_opts |
Macros | |
| #define | TYPE_LOCK 0 |
| #define | TYPE_SHM 1 |
| #define | TYPE_SINGLETON 2 |
Typedefs | |
| typedef int | type_t |
Functions | |
| static void | func_delete (pair< string, pair< resource *, int > > arg) |
| pthread_mutex_t * | rm_acquire_shared_lock (const char *name) |
| void * | rm_get_shm (const char *name, int size) |
| void | rm_lock () |
| void | rm_release_shared_lock (const char *name) |
| void * | rm_singleton (const char *name, singleton_initializer_t initializer, void *data, singleton_deleter_t done) |
| void | rm_unlock () |
Variables | |
| static resource_manager_t | resource_manager |
Seldom used, currently only in x11_common.c. But the managed resources cannot be easily replaced by static variables there because there will be multiple instances of static vars in case of modular UltraGrid build (every library compiled with that file defining the var).
Definition in file resource_manager.cpp.
| #define TYPE_LOCK 0 |
Definition at line 60 of file resource_manager.cpp.
Referenced by resource::create(), resource::get_suffix(), rm_acquire_shared_lock(), and rm_release_shared_lock().
| #define TYPE_SHM 1 |
Definition at line 61 of file resource_manager.cpp.
Referenced by resource::create(), resource::get_suffix(), and rm_get_shm().
| #define TYPE_SINGLETON 2 |
Definition at line 62 of file resource_manager.cpp.
Referenced by resource::create(), resource::get_suffix(), and rm_singleton().
| typedef int type_t |
Definition at line 63 of file resource_manager.cpp.
|
static |
Definition at line 161 of file resource_manager.cpp.
Referenced by resource_manager_t::~resource_manager_t().
| pthread_mutex_t * rm_acquire_shared_lock | ( | const char * | name | ) |
| name | is used to uniquely (!) identify lock. So when requested from 2 locations lock with same name, the same lock handle will be returned |
Definition at line 259 of file resource_manager.cpp.
References resource_manager_t::acquire(), lock::get(), name, resource_manager, and TYPE_LOCK.

| void * rm_get_shm | ( | const char * | name, |
| int | size ) |
Definition at line 285 of file resource_manager.cpp.
References resource_manager_t::acquire(), shm::get(), name, resource_manager, and TYPE_SHM.
Referenced by get_state().

| void rm_lock | ( | ) |
Definition at line 275 of file resource_manager.cpp.
References resource_manager_t::lock(), and resource_manager.
Referenced by get_state().

| void rm_release_shared_lock | ( | const char * | name | ) |
Definition at line 270 of file resource_manager.cpp.
References name, resource_manager_t::release(), resource_manager, and TYPE_LOCK.

| void * rm_singleton | ( | const char * | name, |
| singleton_initializer_t | initializer, | ||
| void * | data, | ||
| singleton_deleter_t | done ) |
Definition at line 296 of file resource_manager.cpp.
References resource_manager_t::acquire(), done(), singleton::get(), name, resource_manager, and TYPE_SINGLETON.

| void rm_unlock | ( | ) |
Definition at line 280 of file resource_manager.cpp.
References resource_manager, and resource_manager_t::unlock().
Referenced by get_state().

|
static |
Definition at line 231 of file resource_manager.cpp.
Referenced by rm_acquire_shared_lock(), rm_get_shm(), rm_lock(), rm_release_shared_lock(), rm_singleton(), and rm_unlock().