set explicit scheduling for new thread from calling thread, not self
if setting scheduling properties succeeds, the new thread may end up with lower priority than the caller, and may be unable to continue running due to another intermediate-priority thread. this produces a priority inversion situation for the thread calling pthread_create, since it cannot return until the new thread reports success. originally, the parent was responsible for setting the new thread's priority; commits b8742f32 and 40bae2d3 changed it as part of trimming down the pthread structure. since then, commit 04335d92 partly reversed the changes, but did not switch responsibilities back. do that now.
Showing
想要评论请 注册 或 登录