mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Bogdan Nistor <Bogdan.Nistor@enea.com>
Cc: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: Re: [musl] pthread_mutexattr_getprotocol() issue
Date: Mon, 7 Dec 2020 17:34:34 -0500	[thread overview]
Message-ID: <20201207223433.GI534@brightrain.aerifal.cx> (raw)
In-Reply-To: <VE1PR03MB5248247EB66D8CF590CE204988CE0@VE1PR03MB5248.eurprd03.prod.outlook.com>

On Mon, Dec 07, 2020 at 10:09:54AM +0000, Bogdan Nistor wrote:
> 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;
> }

Thanks. I'm doing it just by moving the bit around since that's how
the other similar functions are implemented now. Expect the fix to be
included in the next release, which should appear in the next couple
days.

Rich

      reply	other threads:[~2020-12-07 22:34 UTC|newest]

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

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=20201207223433.GI534@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=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).