libthread_xu: Properly inherit the creating thread's sched_priority.
authorSascha Wildner <saw@online.de>
Mon, 3 Feb 2014 00:40:21 +0000 (01:40 +0100)
committerSascha Wildner <saw@online.de>
Mon, 3 Feb 2014 00:42:01 +0000 (01:42 +0100)
commit6cec49168ad7dec1e8fc9ddfbcb77d4b80c51ce0
tree7e2484425e67c6d186dfc2b53a67f5c7033d2894
parent51b0e9d42e8573aa82da9df775a6c831386bcb76
libthread_xu: Properly inherit the creating thread's sched_priority.

When a new thread is created with the inheritsched attribute set to
PTHREAD_INHERIT_SCHED, then it must inherit the sched_priority
scheduling parameter from the creating thread, because POSIX sez:

"The following thread scheduling attributes defined by POSIX.1-2008
are affected by the inheritsched attribute: [...], scheduling parameters
(schedparam), [...]"

Also:

"For SCHED_FIFO and SCHED_RR, the only required member of the sched_param
structure is the priority sched_priority. For SCHED_OTHER, the affected
scheduling parameters are implementation-defined."

For SCHED_OTHER, it will currently inherit the creating thread's
sched_priority too. We'll see if that poses a problem.
lib/libthread_xu/thread/thr_create.c