Use internal job ids in builtin_wait

This avoids any potential issues due to recycled job IDs.
No user visible change.
This commit is contained in:
ridiculousfish
2021-05-13 12:11:00 -07:00
parent 6bae9ebe62
commit aeabc76b2e
4 changed files with 28 additions and 23 deletions

View File

@@ -389,8 +389,10 @@ class parser_t : public std::enable_shared_from_this<parser_t> {
void job_promote(job_t *job);
/// Return the job with the specified job id. If id is 0 or less, return the last job used.
job_t *job_get(job_id_t job_id);
const job_t *job_get(job_id_t job_id) const;
const job_t *job_with_id(job_id_t job_id) const;
/// Return the job with the specified internal job id.
const job_t *job_with_internal_id(internal_job_id_t job_id) const;
/// Returns the job with the given pid.
job_t *job_get_from_pid(pid_t pid) const;