mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-09-07 17:26:32 +00:00
OS test: add some locking and unlocking of the scheduler to the sporadic scheduler test in order to test a few more cases
This commit is contained in:
parent
e15a186530
commit
51b645eb34
1 changed files with 8 additions and 0 deletions
|
|
@ -96,6 +96,7 @@ static void *fifo_func(void *parameter)
|
|||
{
|
||||
do
|
||||
{
|
||||
sched_lock(); /* Just to exercise more logic */
|
||||
ret = sched_getparam(0, ¶m);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
|
@ -104,12 +105,15 @@ static void *fifo_func(void *parameter)
|
|||
}
|
||||
|
||||
now = time(NULL);
|
||||
sched_unlock();
|
||||
}
|
||||
while (now == last);
|
||||
|
||||
sched_lock(); /* Just to exercise more logic */
|
||||
printf("%4lu FIFO: %d\n",
|
||||
(unsigned long)(now-g_start_time), param.sched_priority);
|
||||
last = now;
|
||||
sched_unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -129,6 +133,7 @@ static void *sporadic_func(void *parameter)
|
|||
{
|
||||
do
|
||||
{
|
||||
sched_lock(); /* Just to exercise more logic */
|
||||
ret = sched_getparam(0, ¶m);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
|
@ -137,13 +142,16 @@ static void *sporadic_func(void *parameter)
|
|||
}
|
||||
|
||||
now = time(NULL);
|
||||
sched_unlock();
|
||||
}
|
||||
while (now == last && prio == param.sched_priority);
|
||||
|
||||
sched_lock(); /* Just to exercise more logic */
|
||||
printf("%4lu SPORADIC: %d->%d\n",
|
||||
(unsigned long)(now-g_start_time), prio, param.sched_priority);
|
||||
prio = param.sched_priority;
|
||||
last = now;
|
||||
sched_unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue