mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
asset: Use static lock
The mutex life cycle follows processs.
This commit is contained in:
parent
e2533a68dc
commit
691b6f6f04
1 changed files with 3 additions and 4 deletions
|
@ -145,7 +145,7 @@ typedef struct
|
||||||
} GESAssetCacheEntry;
|
} GESAssetCacheEntry;
|
||||||
|
|
||||||
/* Also protect all the entries in the cache */
|
/* Also protect all the entries in the cache */
|
||||||
static GMutex asset_cache_lock;
|
G_LOCK_DEFINE_STATIC (asset_cache_lock);
|
||||||
/* We are mapping entries by types and ID, such as:
|
/* We are mapping entries by types and ID, such as:
|
||||||
*
|
*
|
||||||
* {
|
* {
|
||||||
|
@ -169,8 +169,8 @@ static GMutex asset_cache_lock;
|
||||||
* different extractable types.
|
* different extractable types.
|
||||||
**/
|
**/
|
||||||
static GHashTable *type_entries_table = NULL;
|
static GHashTable *type_entries_table = NULL;
|
||||||
#define LOCK_CACHE (g_mutex_lock (&asset_cache_lock))
|
#define LOCK_CACHE (G_LOCK (asset_cache_lock))
|
||||||
#define UNLOCK_CACHE (g_mutex_unlock (&asset_cache_lock))
|
#define UNLOCK_CACHE (G_UNLOCK (asset_cache_lock))
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
_check_and_update_parameters (GType * extractable_type, const gchar * id,
|
_check_and_update_parameters (GType * extractable_type, const gchar * id,
|
||||||
|
@ -631,7 +631,6 @@ ges_asset_cache_put (GESAsset * asset, GTask * task)
|
||||||
void
|
void
|
||||||
ges_asset_cache_init (void)
|
ges_asset_cache_init (void)
|
||||||
{
|
{
|
||||||
g_mutex_init (&asset_cache_lock);
|
|
||||||
type_entries_table = g_hash_table_new_full (g_str_hash, g_str_equal,
|
type_entries_table = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||||
NULL, (GDestroyNotify) g_hash_table_unref);
|
NULL, (GDestroyNotify) g_hash_table_unref);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue