aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2022-08-31 20:48:08 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2023-01-13 17:03:57 +0000
commit663922f6186bfaf9b30226d42bc00c452d98d26b (patch)
tree0ad7808caf71fc3b059f0cf557a8a4391920aea7
parent736618054c4f93fd1a81a8f53bf08a558f2f2ba2 (diff)
downloadnewlib-663922f6186bfaf9b30226d42bc00c452d98d26b.zip
newlib-663922f6186bfaf9b30226d42bc00c452d98d26b.tar.gz
newlib-663922f6186bfaf9b30226d42bc00c452d98d26b.tar.bz2
Cygwin: testsuite: Update pthread tests for default SCHED_FIFO
Update for default (and only) thread scheduler policy is SCHED_FIFO.
-rw-r--r--winsup/testsuite/winsup.api/pthread/inherit1.c8
-rw-r--r--winsup/testsuite/winsup.api/pthread/priority1.c6
-rw-r--r--winsup/testsuite/winsup.api/pthread/priority2.c8
3 files changed, 11 insertions, 11 deletions
diff --git a/winsup/testsuite/winsup.api/pthread/inherit1.c b/winsup/testsuite/winsup.api/pthread/inherit1.c
index 545e459..16c3f53 100644
--- a/winsup/testsuite/winsup.api/pthread/inherit1.c
+++ b/winsup/testsuite/winsup.api/pthread/inherit1.c
@@ -65,8 +65,8 @@ main()
int policy;
int inheritsched = -1;
- assert((maxPrio = sched_get_priority_max(SCHED_OTHER)) != -1);
- assert((minPrio = sched_get_priority_min(SCHED_OTHER)) != -1);
+ assert((maxPrio = sched_get_priority_max(SCHED_FIFO)) != -1);
+ assert((minPrio = sched_get_priority_min(SCHED_FIFO)) != -1);
assert(pthread_attr_init(&attr) == 0);
assert(pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED) == 0);
@@ -78,9 +78,9 @@ main()
mainParam.sched_priority = prio;
/* Change the main thread priority */
- assert(pthread_setschedparam(mainThread, SCHED_OTHER, &mainParam) == 0);
+ assert(pthread_setschedparam(mainThread, SCHED_FIFO, &mainParam) == 0);
assert(pthread_getschedparam(mainThread, &policy, &mainParam) == 0);
- assert(policy == SCHED_OTHER);
+ assert(policy == SCHED_FIFO);
assert(mainParam.sched_priority == prio);
for (param.sched_priority = prio;
diff --git a/winsup/testsuite/winsup.api/pthread/priority1.c b/winsup/testsuite/winsup.api/pthread/priority1.c
index b740b99..a1e8d05 100644
--- a/winsup/testsuite/winsup.api/pthread/priority1.c
+++ b/winsup/testsuite/winsup.api/pthread/priority1.c
@@ -47,7 +47,7 @@ void * func(void * arg)
struct sched_param param;
assert(pthread_getschedparam(pthread_self(), &policy, &param) == 0);
- assert(policy == SCHED_OTHER);
+ assert(policy == SCHED_FIFO);
return (void *)(size_t)param.sched_priority;
}
@@ -58,8 +58,8 @@ main()
pthread_attr_t attr;
void * result = NULL;
struct sched_param param;
- int maxPrio = sched_get_priority_max(SCHED_OTHER);
- int minPrio = sched_get_priority_min(SCHED_OTHER);
+ int maxPrio = sched_get_priority_max(SCHED_FIFO);
+ int minPrio = sched_get_priority_min(SCHED_FIFO);
assert(pthread_attr_init(&attr) == 0);
assert(pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED) == 0);
diff --git a/winsup/testsuite/winsup.api/pthread/priority2.c b/winsup/testsuite/winsup.api/pthread/priority2.c
index d2d0b06..0534e7b 100644
--- a/winsup/testsuite/winsup.api/pthread/priority2.c
+++ b/winsup/testsuite/winsup.api/pthread/priority2.c
@@ -51,7 +51,7 @@ void * func(void * arg)
assert(pthread_mutex_lock(&startMx) == 0);
assert(pthread_getschedparam(pthread_self(), &policy, &param) == 0);
assert(pthread_mutex_unlock(&startMx) == 0);
- assert(policy == SCHED_OTHER);
+ assert(policy == SCHED_FIFO);
return (void *) (size_t)param.sched_priority;
}
@@ -61,8 +61,8 @@ main()
pthread_t t;
void * result = NULL;
struct sched_param param;
- int maxPrio = sched_get_priority_max(SCHED_OTHER);
- int minPrio = sched_get_priority_min(SCHED_OTHER);
+ int maxPrio = sched_get_priority_max(SCHED_FIFO);
+ int minPrio = sched_get_priority_min(SCHED_FIFO);
for (param.sched_priority = minPrio;
param.sched_priority <= maxPrio;
@@ -70,7 +70,7 @@ main()
{
assert(pthread_mutex_lock(&startMx) == 0);
assert(pthread_create(&t, NULL, func, NULL) == 0);
- assert(pthread_setschedparam(t, SCHED_OTHER, &param) == 0);
+ assert(pthread_setschedparam(t, SCHED_FIFO, &param) == 0);
assert(pthread_mutex_unlock(&startMx) == 0);
pthread_join(t, &result);
assert((int)(size_t)result == param.sched_priority);