[brasero/gnome-2-28] Instead of waiting for the end of the probing thread cancel it if a new probe is required
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [brasero/gnome-2-28] Instead of waiting for the end of the probing thread cancel it if a new probe is required
- Date: Mon, 19 Oct 2009 15:16:19 +0000 (UTC)
commit d8b4dc0ec1d13af20e39e51571f68a5c76a5fa0c
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Thu Oct 15 12:48:45 2009 +0200
Instead of waiting for the end of the probing thread cancel it if a new probe is required
libbrasero-media/brasero-drive.c | 33 ++++++++++++++-------------------
1 files changed, 14 insertions(+), 19 deletions(-)
---
diff --git a/libbrasero-media/brasero-drive.c b/libbrasero-media/brasero-drive.c
index f5094ab..7236ac2 100644
--- a/libbrasero-media/brasero-drive.c
+++ b/libbrasero-media/brasero-drive.c
@@ -524,6 +524,8 @@ brasero_drive_unlock (BraseroDrive *drive)
if (priv->probe_waiting) {
/* See if a probe was waiting */
priv->probe_waiting = FALSE;
+
+ BRASERO_MEDIA_LOG ("Probe on hold");
brasero_drive_probe_inside (drive);
}
}
@@ -982,28 +984,21 @@ brasero_drive_probe_inside (BraseroDrive *drive)
priv = BRASERO_DRIVE_PRIVATE (drive);
- priv->probed = FALSE;
-
/* Check that a probe is not already being performed */
- g_mutex_lock (priv->mutex);
- if (!priv->probe) {
- BRASERO_MEDIA_LOG ("Setting new probe");
-
- if (priv->probe_id) {
- /* Remove the result reporting as
- * the status seem to have changed */
- g_source_remove (priv->probe_id);
- priv->probe_id = 0;
- }
-
- priv->probe = g_thread_create (brasero_drive_probe_inside_thread,
- drive,
- FALSE,
- NULL);
- }
- else
+ if (priv->probe) {
BRASERO_MEDIA_LOG ("Ongoing probe");
+ brasero_drive_cancel_probing (drive);
+ }
+
+ BRASERO_MEDIA_LOG ("Setting new probe");
+
+ priv->probed = FALSE;
+ g_mutex_lock (priv->mutex);
+ priv->probe = g_thread_create (brasero_drive_probe_inside_thread,
+ drive,
+ FALSE,
+ NULL);
g_mutex_unlock (priv->mutex);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]