mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
Work on async cleanup
Track all async changes and only perform free of resources when all previous async operations completed.
This commit is contained in:
parent
7ecfc28d0f
commit
1d61fd3696
19 changed files with 270 additions and 130 deletions
|
|
@ -32,6 +32,7 @@ extern "C" {
|
|||
|
||||
typedef enum {
|
||||
SPA_RESULT_ASYNC = (1 << 30),
|
||||
SPA_RESULT_WAIT_SYNC = 2,
|
||||
SPA_RESULT_MODIFIED = 1,
|
||||
SPA_RESULT_OK = 0,
|
||||
SPA_RESULT_ERROR = -1,
|
||||
|
|
|
|||
|
|
@ -40,16 +40,27 @@ struct _SpaDict {
|
|||
SpaDictItem *items;
|
||||
};
|
||||
|
||||
#define spa_dict_for_each(item, dict) \
|
||||
for ((item) = (dict)->items; \
|
||||
(item) < &(dict)->items[(dict)->n_items]; \
|
||||
(item)++)
|
||||
|
||||
static inline SpaDictItem *
|
||||
spa_dict_lookup_item (const SpaDict *dict, const char *key)
|
||||
{
|
||||
SpaDictItem *item;
|
||||
spa_dict_for_each (item, dict) {
|
||||
if (!strcmp (item->key, key))
|
||||
return item;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline const char *
|
||||
spa_dict_lookup (const SpaDict *dict, const char *key)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < dict->n_items; i++) {
|
||||
if (!strcmp (dict->items[i].key, key))
|
||||
return dict->items[i].value;
|
||||
}
|
||||
return NULL;
|
||||
SpaDictItem *item = spa_dict_lookup_item (dict, key);
|
||||
return item ? item->value : NULL;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue