https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3d6d9d0253c72bd3b7283022bda4e9e9595fbae8
commit 3d6d9d0253c72bd3b7283022bda4e9e9595fbae8 Author: Jon Turney <[email protected]> Date: Thu Jul 6 16:39:13 2023 +0100 Cygwin: pthread: Take note of schedparam in pthread_create Take note of schedparam in any pthread_attr_t passed to pthread_create. postcreate() (racily, after the thread is actually created), sets the scheduling priority if it's inherited, but precreate() doesn't store any scheduling priority explicitly set via a non-default attr to create. Question: What is the mechanism which sets pthread::attr to defaults when newattr isn't provided? Diff: --- winsup/cygwin/thread.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index f614e01c4..afddf4282 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -457,6 +457,7 @@ pthread::precreate (pthread_attr *newattr) attr.joinable = newattr->joinable; attr.contentionscope = newattr->contentionscope; attr.inheritsched = newattr->inheritsched; + attr.schedparam = newattr->schedparam; attr.stackaddr = newattr->stackaddr; attr.stacksize = newattr->stacksize; attr.guardsize = newattr->guardsize;
