Fix potential race condition in job_time_limit.
Introduced by commit 059275f6 when the timer is trigger. Releasing the locks means that job_ptr may point to an element that was deleted by a different thread in the meantime. Restructuring the code to advance the iterator prevents this - the iterator itself does not have this issue as the List structure will manage the position during the sleep(). While here, move the reservation update handling outside of this loop to simplify operation. This does not need to piggy-back on the scan of the job_list - switching to using list_for_each should mitigate some of the performance loss by needing a second full pass. Bug 3414.
Please register or sign in to comment