[brasero] Instead of waiting for the end of the probing thread cancel it if a new probe is required



commit e6f2234e5dfc47d67217b414d99ddb4b6ac581d0
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 |   32 ++++++++++++--------------------
 1 files changed, 12 insertions(+), 20 deletions(-)
---
diff --git a/libbrasero-media/brasero-drive.c b/libbrasero-media/brasero-drive.c
index d7bd001..9915dc5 100644
--- a/libbrasero-media/brasero-drive.c
+++ b/libbrasero-media/brasero-drive.c
@@ -566,7 +566,6 @@ brasero_drive_unlock (BraseroDrive *drive)
 			BRASERO_MEDIA_LOG ("Probe on hold");
 
 			/* A probe was waiting */
-			priv->probe_waiting = FALSE;
 			brasero_drive_probe_inside (drive);
 		}
 	}
@@ -1028,29 +1027,22 @@ brasero_drive_probe_inside (BraseroDrive *drive)
 
 	priv = BRASERO_DRIVE_PRIVATE (drive);
 
+	/* Check that a probe is not already being performed */
+	if (priv->probe) {
+		BRASERO_MEDIA_LOG ("Ongoing probe");
+		brasero_drive_cancel_probing (drive);
+	}
+
+	BRASERO_MEDIA_LOG ("Setting new probe");
+
 	priv->probed = FALSE;
 	priv->probe_waiting = 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
-		BRASERO_MEDIA_LOG ("Ongoing probe");
-
+	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]