Skip to content
Snippets Groups Projects
Unverified Commit c0b7e6ba authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #1284 from sleuthkit/img_writer_delay

Added delay into image writer to not starve other readers
parents ccc72e56 ed1c5c30
Branches
Tags
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