[gnome-software] Don't show a warning when one thread removes another threads timer
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Don't show a warning when one thread removes another threads timer
- Date: Fri, 27 May 2016 15:31:21 +0000 (UTC)
commit 6ddc23066b4c2b31026c61030e04a8100ea37217
Author: Richard Hughes <richard hughsie com>
Date: Fri May 27 13:49:19 2016 +0100
Don't show a warning when one thread removes another threads timer
src/gs-plugin.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin.c b/src/gs-plugin.c
index d61a685..26dc443 100644
--- a/src/gs-plugin.c
+++ b/src/gs-plugin.c
@@ -69,6 +69,7 @@ typedef struct
gint scale;
guint priority;
guint timer_id;
+ GMutex timer_mutex;
} GsPluginPrivate;
G_DEFINE_TYPE_WITH_PRIVATE (GsPlugin, gs_plugin, G_TYPE_OBJECT)
@@ -186,6 +187,7 @@ gs_plugin_finalize (GObject *object)
g_object_unref (priv->soup_session);
g_hash_table_unref (priv->cache);
g_mutex_clear (&priv->cache_mutex);
+ g_mutex_clear (&priv->timer_mutex);
g_module_close (priv->module);
}
@@ -259,6 +261,7 @@ gs_plugin_action_delay_cb (gpointer user_data)
{
GsPlugin *plugin = GS_PLUGIN (user_data);
GsPluginPrivate *priv = gs_plugin_get_instance_private (plugin);
+ g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&priv->timer_mutex);
g_debug ("plugin no longer recently active: %s", priv->name);
priv->flags &= ~GS_PLUGIN_FLAGS_RECENT;
@@ -276,6 +279,7 @@ void
gs_plugin_action_stop (GsPlugin *plugin)
{
GsPluginPrivate *priv = gs_plugin_get_instance_private (plugin);
+ g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&priv->timer_mutex);
/* clear plugin as SELF */
priv->flags &= ~GS_PLUGIN_FLAGS_RUNNING_SELF;
@@ -1054,6 +1058,7 @@ gs_plugin_init (GsPlugin *plugin)
g_free,
(GDestroyNotify) g_object_unref);
g_mutex_init (&priv->cache_mutex);
+ g_mutex_init (&priv->timer_mutex);
g_rw_lock_init (&priv->rwlock);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]