In #Blender 3.3 it will be easier (read: possible) to keep track of render and object baking jobs from Python. You can poll whether such jobs are currently running, and also get notified about completion & cancellation: https://wiki.blender.org/wiki/Reference/Release_Notes/3.3/Python_API#Background_Jobs