What is your operating system?
The meaning of the members of struct sched_param
is implementation defined for scheduling policy SCHED_OTHER
.
For example, on GNU/Linux, unless the scheduling policy is SCHED_RR
or SCHED_FIFO
, the sched_priority
member is not used and must be set to 0.
Other than that, the fifth thread (the last) also prints its state and priority.