brasero r1826 - in trunk: . libbrasero-media
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1826 - in trunk: . libbrasero-media
- Date: Sat, 24 Jan 2009 13:42:46 +0000 (UTC)
Author: philippr
Date: Sat Jan 24 13:42:45 2009
New Revision: 1826
URL: http://svn.gnome.org/viewvc/brasero?rev=1826&view=rev
Log:
2009-01-24 Philippe Rouquier <ykw localhost localdomain>
Make sure libbrasero-media is more MT safe by using GDK_THREADS_*() macros
* libbrasero-media/brasero-drive.c (brasero_drive_medium_probed):
* libbrasero-media/brasero-gio-operation.c
(brasero_gio_operation_wait_for_operation_end):
* libbrasero-media/brasero-medium-monitor.c
(brasero_medium_monitor_inserted_cb):
* libbrasero-media/brasero-medium.c (brasero_medium_probed):
Modified:
trunk/ChangeLog
trunk/libbrasero-media/brasero-drive.c
trunk/libbrasero-media/brasero-gio-operation.c
trunk/libbrasero-media/brasero-medium-monitor.c
trunk/libbrasero-media/brasero-medium.c
Modified: trunk/libbrasero-media/brasero-drive.c
==============================================================================
--- trunk/libbrasero-media/brasero-drive.c (original)
+++ trunk/libbrasero-media/brasero-drive.c Sat Jan 24 13:42:45 2009
@@ -709,6 +709,7 @@
priv = BRASERO_DRIVE_PRIVATE (self);
/* only when it is probed */
+ /* NOTE: BraseroMedium calls GDK_THREADS_ENTER/LEAVE() around g_signal_emit () */
priv->probed = TRUE;
g_signal_emit (self,
drive_signals [MEDIUM_INSERTED],
Modified: trunk/libbrasero-media/brasero-gio-operation.c
==============================================================================
--- trunk/libbrasero-media/brasero-gio-operation.c (original)
+++ trunk/libbrasero-media/brasero-gio-operation.c Sat Jan 24 13:42:45 2009
@@ -122,8 +122,11 @@
brasero_gio_operation_timeout,
operation);
- operation->loop = g_main_loop_new (NULL, FALSE);
- g_main_loop_run (operation->loop);
+ operation->loop = g_main_loop_new (NULL, FALSE);
+
+ GDK_THREADS_LEAVE ();
+ g_main_loop_run (operation->loop);
+ GDK_THREADS_ENTER ();
g_main_loop_unref (operation->loop);
operation->loop = NULL;
Modified: trunk/libbrasero-media/brasero-medium-monitor.c
==============================================================================
--- trunk/libbrasero-media/brasero-medium-monitor.c (original)
+++ trunk/libbrasero-media/brasero-medium-monitor.c Sat Jan 24 13:42:45 2009
@@ -324,6 +324,18 @@
drive = brasero_drive_new (udi);
priv->drives = g_slist_prepend (priv->drives, drive);
+
+ /* connect to signals. This must come before the g_signal_emit () so we
+ * are the first to get an update on the medium inside. */
+ g_signal_connect (drive,
+ "medium-added",
+ G_CALLBACK (brasero_medium_monitor_medium_added_cb),
+ self);
+ g_signal_connect (drive,
+ "medium-removed",
+ G_CALLBACK (brasero_medium_monitor_medium_removed_cb),
+ self);
+
g_signal_emit (self,
medium_monitor_signals [DRIVE_ADDED],
0,
@@ -335,16 +347,6 @@
medium_monitor_signals [MEDIUM_INSERTED],
0,
brasero_drive_get_medium (drive));
-
- /* connect to signals */
- g_signal_connect (drive,
- "medium-added",
- G_CALLBACK (brasero_medium_monitor_medium_added_cb),
- self);
- g_signal_connect (drive,
- "medium-removed",
- G_CALLBACK (brasero_medium_monitor_medium_removed_cb),
- self);
}
static void
Modified: trunk/libbrasero-media/brasero-medium.c
==============================================================================
--- trunk/libbrasero-media/brasero-medium.c (original)
+++ trunk/libbrasero-media/brasero-medium.c Sat Jan 24 13:42:45 2009
@@ -40,6 +40,7 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
+#include <gdk/gdk.h>
#include "burn-basics.h"
@@ -3269,9 +3270,11 @@
priv = BRASERO_MEDIUM_PRIVATE (data);
/* This signal must be emitted in the main thread */
+ GDK_THREADS_ENTER ();
g_signal_emit (data,
medium_signals [PROBED],
0);
+ GDK_THREADS_LEAVE ();
priv->probe_id = 0;
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]