aboutsummaryrefslogtreecommitdiff
path: root/kernel/proc/sched.c
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2024-03-02 23:05:26 +0000
committersotech117 <michael_foiani@brown.edu>2024-03-02 23:05:26 +0000
commit8c2e0ce946012a4275e8dfa9d8dfd1d5a68d6e3e (patch)
tree1877a33c6488a5b16fb7962e1ffb0f72f13a5052 /kernel/proc/sched.c
parent9c90e73fda0d5df2e1f11b32d459d3bb07a63192 (diff)
decent coding session
Diffstat (limited to 'kernel/proc/sched.c')
-rw-r--r--kernel/proc/sched.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/proc/sched.c b/kernel/proc/sched.c
index 31976bb..c8f209c 100644
--- a/kernel/proc/sched.c
+++ b/kernel/proc/sched.c
@@ -168,9 +168,17 @@ long sched_cancellable_sleep_on(ktqueue_t *queue)
curthr->kt_state = KT_SLEEP_CANCELLABLE;
+ if (curthr->kt_cancelled)
+ {
+ return -EINTR;
+ }
+
sched_switch(queue);
- // TODO: finish this function - consider the ipl_wait() function
+ if (curthr->kt_cancelled)
+ {
+ return -EINTR;
+ }
return 0;
}