aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/rc/job.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-10-19 13:28:01 -0700
committerNicholas Noll <nbnoll@eml.cc>2021-10-19 13:28:01 -0700
commit2b53bca326decd50012883f0cff3b5316a3e100d (patch)
tree570220ba22df388958e296f09add682720de6b51 /sys/cmd/rc/job.c
parentaf3fa90e8bb41c306c5fe2d2cf105db6bbabd1d9 (diff)
feat(rc): prototype of async jobs
Diffstat (limited to 'sys/cmd/rc/job.c')
-rw-r--r--sys/cmd/rc/job.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/cmd/rc/job.c b/sys/cmd/rc/job.c
index 779ce6c..a8747e9 100644
--- a/sys/cmd/rc/job.c
+++ b/sys/cmd/rc/job.c
@@ -21,16 +21,16 @@ void
report(Thread *job, int index)
{
switch(job->wait.status){
- case PDone:
+ case Pdone:
print(shell.err, "job %d [%d]: done\n", index, job->pid);
break;
- case PStop:
+ case Pstop:
print(shell.err, "job %d [%d]: suspended\n", index, job->pid);
break;
- case PAgain:
+ case Pagain:
print(shell.err, "job %d [%d]: continued\n", index, job->pid);
break;
- case PRun:
+ case Prun:
print(shell.err, "job %d [%d]: running\n", index, job->pid);
break;
default:
@@ -42,10 +42,10 @@ void
wakeup(Thread *t)
{
int i;
- t->wait.status = PRun;
+ t->wait.status = Prun;
for(i=0; i < t->wait.len; i++){
- if(t->wait.on[i].status == PStop)
- t->wait.on[i].status = PRun;
+ if(t->wait.on[i].status == Pstop)
+ t->wait.on[i].status = Prun;
}
}
@@ -68,6 +68,7 @@ addjob(Thread *job)
{
job->next = shell.jobs;
shell.jobs = job;
+ job->wait.status = Prun;
}
void