Skip to content

Commit

Permalink
Fixed issue introduced with last update
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Miller committed Nov 7, 2023
1 parent 944c141 commit e47a5eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ static void posix_timer_callback(struct posix_timer *timer) {
.timer.overrun = 0,
.timer.value = timer->sig_value,
};
lock(&pids_lock);
lock(&pids_lock,0);
struct task *thread = pid_get_task(timer->thread_pid);
// TODO: solve pid reuse. currently we have two ways of referring to a task: pid_t_ and struct task *. pids get reused. task struct pointers get freed on exit or reap. need a third option for cases like this, like a refcount layer.
if (thread != NULL)
Expand All @@ -294,7 +294,7 @@ int_t sys_timer_create(dword_t clock, addr_t sigevent_addr, addr_t timer_addr) {
return _EINVAL;

if (sigev.method == SIGEV_THREAD_ID_) {
lock(&pids_lock);
lock(&pids_lock,0);
if (pid_get_task(sigev.tid) == NULL)
return _EINVAL;
unlock(&pids_lock);
Expand Down

0 comments on commit e47a5eb

Please sign in to comment.