From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id A92543857710; Sun, 9 Jul 2023 16:01:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A92543857710 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688918494; bh=ljR1VFZ27Cs+WL0u5aEKTvY/esf6KEWUv7ULog8x9AE=; h=From:To:Subject:Date:From; b=p88jqnJLiNs3QNL5gwunKk40nxpGAqkEoQ/VsZNRdQI+eTGAadyRtf8TDFgrvx5Od FxBol17qwFCwheGFLzlEjGuXaknRs/fYPUIuTvCg4XmrdOpDFq/AlM0uXSPavw11Bh jvK6PpqJlshmF4msmfCc/wcbJmYD1w68l2bYeJJ4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jon Turney To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pthread: Take note of schedparam in pthread_create X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Turney X-Git-Refname: refs/heads/master X-Git-Oldrev: 15d71e496187c7c38a7a207c7d0e45f0bb81f93b X-Git-Newrev: 3d6d9d0253c72bd3b7283022bda4e9e9595fbae8 Message-Id: <20230709160134.A92543857710@sourceware.org> Date: Sun, 9 Jul 2023 16:01:34 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D3d6d9d0253c= 72bd3b7283022bda4e9e9595fbae8 commit 3d6d9d0253c72bd3b7283022bda4e9e9595fbae8 Author: Jon Turney Date: Thu Jul 6 16:39:13 2023 +0100 Cygwin: pthread: Take note of schedparam in pthread_create =20 Take note of schedparam in any pthread_attr_t passed to pthread_create. =20 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. =20 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 =3D newattr->joinable; attr.contentionscope =3D newattr->contentionscope; attr.inheritsched =3D newattr->inheritsched; + attr.schedparam =3D newattr->schedparam; attr.stackaddr =3D newattr->stackaddr; attr.stacksize =3D newattr->stacksize; attr.guardsize =3D newattr->guardsize;