Fixed a theoretically possible race condition of burn end and ISO generator end
This commit is contained in:
parent
b70f5a9041
commit
82941f4c99
@ -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 first_base_count= 0.0, norm= 0.0, now_time, fract_offset= 0.0;
|
||||||
double measured_speed, speed_factor= 1385000, quot;
|
double measured_speed, speed_factor= 1385000, quot;
|
||||||
time_t time_prediction;
|
time_t time_prediction;
|
||||||
|
IsoImage *image= NULL;
|
||||||
|
|
||||||
|
image= isoburn_get_attached_image(drive);
|
||||||
|
|
||||||
start_time= Sfile_microtime(0);
|
start_time= Sfile_microtime(0);
|
||||||
while(burn_drive_get_status(drive, NULL) == BURN_DRIVE_SPAWNING)
|
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_time= current_time;
|
||||||
last_sector= progress.sector;
|
last_sector= progress.sector;
|
||||||
drive_status= burn_drive_get_status(drive, &progress);
|
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;
|
break;
|
||||||
|
if(!iso_image_generator_is_running(image))
|
||||||
|
break;
|
||||||
|
}
|
||||||
current_time= Sfile_microtime(0);
|
current_time= Sfile_microtime(0);
|
||||||
if(drive_status == BURN_DRIVE_WRITING && progress.sectors > 0) {
|
if(drive_status == BURN_DRIVE_WRITING && progress.sectors > 0) {
|
||||||
if(current_time-last_time>0.2)
|
if(current_time-last_time>0.2)
|
||||||
|
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2010.10.05.180016"
|
#define Xorriso_timestamP "2010.10.06.162230"
|
||||||
|
Loading…
Reference in New Issue
Block a user