Fix a race condition forced by dt_history_delete_on_image_ext()
#20159
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Raising
DT_SIGNAL_TAG_CHANGEDindt_history_delete_on_image_ext()possibly leads to a race condition in the_control_work_res()dispatcher, both fight for the imgid lock possibly leading to a standstill on fast systems.If we want the signal we have the explicit
dt_history_delete_on_image()doing that.Raising
DT_SIGNAL_DEVELOP_MIPMAP_UPDATEDis done after unlocking imgid.While being here:
dt_history_hash_write_from_history()is also done while the imgid is locked for history changes.history.hcheck for a valid imgid for safetydt_history_item_as_string()is only used here so static and removed fromhistory.hdt_history_end_attop()is static so it has been renamed according to standard._control_generic_images_job_create()g_main_context_invoke()variant and modified the return value for maintenance.Release note: Fixed a possibly standstill while discarding history on fast systems
Fixes #20151