Skip to content
Snippets Groups Projects
Commit ed1c5c30 authored by Brian Carrier's avatar Brian Carrier
Browse files

Added delay into image writer to not starve other readers

parent 6e6d4ae5
No related branches found
No related tags found
No related merge requests found
...@@ -575,8 +575,15 @@ static TSK_RETVAL_ENUM tsk_img_writer_finish_image(TSK_IMG_WRITER* img_writer) { ...@@ -575,8 +575,15 @@ static TSK_RETVAL_ENUM tsk_img_writer_finish_image(TSK_IMG_WRITER* img_writer) {
return TSK_ERR; return TSK_ERR;
} }
/* Using tsk_img_read here to make sure we get the lock */ /* Using tsk_img_read here to make sure we get the lock */
tsk_img_read(img_writer->img_info, offset, buffer, TSK_IMG_INFO_CACHE_LEN); if (tsk_img_read(img_writer->img_info, offset, buffer, TSK_IMG_INFO_CACHE_LEN) < 0) {
// this usually happens when the device has been unplugged
return TSK_ERR;
}
} }
/* In Autopsy, tsk_img_writer_finish_image() was starving other threads that were trying to do
* basic reads and made the app impossible to use. Add the short sleep to give
* other threads a chance to get the underlying locks. */
Sleep(1);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment