mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Bogdan Nistor <Bogdan.Nistor@enea.com>
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: [musl] pthread_mutexattr_getprotocol() issue
Date: Mon, 7 Dec 2020 10:09:54 +0000	[thread overview]
Message-ID: <VE1PR03MB5248247EB66D8CF590CE204988CE0@VE1PR03MB5248.eurprd03.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1947 bytes --]

Hi,

While using MUSL C-library 1.1.22. we observed an issue with the pthread_mutexattr_getprotocol() implementation. The same implementation is in the latest version also.
When the priority inheritance mutexes were implemented, it seems that pthread_mutexattr_getprotocol() wasn't updated to return the proper mutex protocol type.

The PI mutexes update was done in this commit: http://git.musl-libc.org/cgit/musl/commit/?id=54ca677983d47529bab8752315ac1a2b49888870

If possible, maybe the get protocol function can be updated in a future merge.

In order to fix the get protocol function, we changed it to:
int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *restrict a, int *restrict protocol)
{
   if (a->__attr & 8)
               *protocol = PTHREAD_PRIO_INHERIT;
   else
               *protocol = PTHREAD_PRIO_NONE;
               return 0;
}

Best Regards,
Bogdan Nistor
Software Engineer
Enterprise Business Unit
Email
Bogdan.Nistor@enea.com
Phone
+40 74 517 5795

Enea
319 Splaiul Independentei
OB403A District 6
Bucharest 060044, ROMANIA

[https://www.enea.com/globalassets/images/enea-email-signature.png]<http://www.enea.com/>



This message, including attachments, is CONFIDENTIAL. It may also be privileged or otherwise protected by law. If you received this email by mistake please let us know by reply and then delete it from your system; you should not copy it or disclose its contents to anyone. All messages sent to and from Enea may be monitored to ensure compliance with internal policies and to protect our business. Emails are not secure and cannot be guaranteed to be error free as they can be intercepted, a mended, lost or destroyed, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of email transmission. Anyone who communicates with us by email accepts these risks.

[-- Attachment #2: Type: text/html, Size: 8443 bytes --]

             reply	other threads:[~2020-12-07 10:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 10:09 Bogdan Nistor [this message]
2020-12-07 22:34 ` Rich Felker

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=VE1PR03MB5248247EB66D8CF590CE204988CE0@VE1PR03MB5248.eurprd03.prod.outlook.com \
    --to=bogdan.nistor@enea.com \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).