[gnome-software/gnome-3-22] trivial: make GsApp slightly more threadsafe
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-22] trivial: make GsApp slightly more threadsafe
- Date: Thu, 8 Dec 2016 11:44:26 +0000 (UTC)
commit c9dc522db8c8f0ea651a1acfee1186b862887c3c
Author: Richard Hughes <richard hughsie com>
Date: Tue Dec 6 14:49:15 2016 +0000
trivial: make GsApp slightly more threadsafe
src/gs-app.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index cf6a637..1167884 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -2637,6 +2637,7 @@ gs_app_add_addon (GsApp *app, GsApp *addon)
{
gpointer found;
const gchar *id;
+ g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&app->mutex);
g_return_if_fail (GS_IS_APP (app));
g_return_if_fail (GS_IS_APP (addon));
@@ -2681,6 +2682,7 @@ gs_app_add_related (GsApp *app, GsApp *app2)
{
gchar *key;
gpointer found;
+ g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&app->mutex);
g_return_if_fail (GS_IS_APP (app));
@@ -2733,6 +2735,7 @@ gs_app_get_history (GsApp *app)
void
gs_app_add_history (GsApp *app, GsApp *app2)
{
+ g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&app->mutex);
g_return_if_fail (GS_IS_APP (app));
g_ptr_array_add (app->history, g_object_ref (app2));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]