public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon Turney <jturney@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: pthread: Take note of schedparam in pthread_create
Date: Sun,  9 Jul 2023 16:01:34 +0000 (GMT)	[thread overview]
Message-ID: <20230709160134.A92543857710@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3d6d9d0253c72bd3b7283022bda4e9e9595fbae8

commit 3d6d9d0253c72bd3b7283022bda4e9e9595fbae8
Author: Jon Turney <jon.turney@dronecode.org.uk>
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;

             reply	other threads:[~2023-07-09 16:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-09 16:01 Jon Turney [this message]
2023-07-18 13:19 Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230709160134.A92543857710@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).