Fixed a theoretically possible race condition of burn end and ISO generator end

This commit is contained in:
Thomas Schmitt 2010-10-06 16:30:54 +00:00
parent cc6d2cd7e9
commit 24b1008f2b
2 changed files with 14 additions and 2 deletions

View File

@ -979,6 +979,9 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
double first_base_count= 0.0, norm= 0.0, now_time, fract_offset= 0.0;
double measured_speed, speed_factor= 1385000, quot;
time_t time_prediction;
IsoImage *image= NULL;
image= isoburn_get_attached_image(drive);
start_time= Sfile_microtime(0);
while(burn_drive_get_status(drive, NULL) == BURN_DRIVE_SPAWNING)
@ -1003,8 +1006,17 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
last_time= current_time;
last_sector= progress.sector;
drive_status= burn_drive_get_status(drive, &progress);
if(drive_status == BURN_DRIVE_IDLE)
if(drive_status == BURN_DRIVE_IDLE) {
/* To avoid a race condition between burn_source and libisofs
writer thread: Wait for ISO generator thread to have finished.
*/
if(image == NULL)
break;
if(!iso_image_generator_is_running(image))
break;
}
current_time= Sfile_microtime(0);
if(drive_status == BURN_DRIVE_WRITING && progress.sectors > 0) {
if(current_time-last_time>0.2)

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.10.05.180016"
#define Xorriso_timestamP "2010.10.06.162230"