diff --git a/sched/clock/clock_gettime.c b/sched/clock/clock_gettime.c index 731c6a2ae3..d3f1cd34a7 100644 --- a/sched/clock/clock_gettime.c +++ b/sched/clock/clock_gettime.c @@ -110,12 +110,12 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp) * CLOCK_MONOTONIC be introduced additional increases to systime. */ - flags = enter_critical_section(); + flags = spin_lock_irqsave(); tp->tv_sec += (uint32_t)g_monotonic_basetime.tv_sec; tp->tv_nsec += (uint32_t)g_monotonic_basetime.tv_nsec; - leave_critical_section(flags); + spin_unlock_irqrestore(flags); /* Handle carry to seconds. */ @@ -163,12 +163,12 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp) * was last set, this gives us the current time. */ - flags = enter_critical_section(); + flags = spin_lock_irqsave(); ts.tv_sec += (uint32_t)g_basetime.tv_sec; ts.tv_nsec += (uint32_t)g_basetime.tv_nsec; - leave_critical_section(flags); + spin_unlock_irqrestore(flags); /* Handle carry to seconds. */ diff --git a/sched/sched/sched_removereadytorun.c b/sched/sched/sched_removereadytorun.c index da4c24a352..aab359aa7d 100644 --- a/sched/sched/sched_removereadytorun.c +++ b/sched/sched/sched_removereadytorun.c @@ -238,8 +238,6 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb) tmptcb = (FAR struct tcb_s *) dq_remfirst((FAR dq_queue_t *)&g_readytorun); - DEBUGASSERT(tmptcb == rtrtcb); - dq_addfirst((FAR dq_entry_t *)tmptcb, tasklist); tmptcb->cpu = cpu;