All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Florian Bezdeka <florian.bezdeka@siemens.com>
Cc: xenomai <xenomai@xenomai.org>, Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [PATCH] Alchemy: Fix rt_task_unblock() for RT_MUTEX
Date: Thu, 31 Mar 2022 10:36:18 +0200 (CEST)	[thread overview]
Message-ID: <637249774.202758.1648715778757.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <74b8e93cc14b656f6d97bff5d6ef2c2dd606f64b.camel@siemens.com>

----- Ursprüngliche Mail -----
> Von: "Florian Bezdeka" <florian.bezdeka@siemens.com>
> I can't say much about the alchemy skin. Never used that myself. Have
> you checked the history if such a change was / could be intentional?
> CCing Jan...

Well, an application that relies on rt_task_unblock() now no longer works
with Xenomai 3. It used to work with 2.6.

In 2019 this was briefly discussed:
https://www.mail-archive.com/xenomai@xenomai.org/msg15990.html

Finally I found some cycles to work on that.

With my changes at least the application works again and the tests
on the customer side pass.
 
> The following comments are more or less implementation details...
> 
>> To restore the functionality provide a new function,
>> pthread_mutex_lock_eintr_np().
>> It can get interrupted and will return EINTR to the caller.
>> 
>> Signed-off-by: Richard Weinberger <richard@nod.at>
>> ---
>>  include/cobalt/pthread.h |  2 ++
>>  lib/alchemy/mutex.c      |  2 +-
>>  lib/cobalt/mutex.c       | 14 ++++++++++++--
>>  3 files changed, 15 insertions(+), 3 deletions(-)
>> 
>> diff --git a/include/cobalt/pthread.h b/include/cobalt/pthread.h
>> index 3e9bd47053bc..2994c2467219 100644
>> --- a/include/cobalt/pthread.h
>> +++ b/include/cobalt/pthread.h
>> @@ -62,6 +62,8 @@ COBALT_DECL(int, pthread_mutex_destroy(pthread_mutex_t
>> *mutex));
>>  
>>  COBALT_DECL(int, pthread_mutex_lock(pthread_mutex_t *mutex));
>>  
>> +COBALT_DECL(int, pthread_mutex_lock_eintr_np(pthread_mutex_t *mutex));
>> +
> 
> COBALT_DECL should only be necessary for functions that live in the
> libc namespace and that need to be "intercepted" / affected by wrapping
> at linker level.
> 
> Your function looks libcobalt specific and as such should probably not
> live in the pthread_mutex_ namespace and generating the wrappers seems
> unnecessary.

Ok!

[...]

>> +COBALT_IMPL(int, pthread_mutex_lock_eintr_np, (pthread_mutex_t *mutex))
>> +{
>> +	return __pthread_mutex_lock(mutex, true);
>> +}
> 
> Same as above. Looks libcobalt specific and the wrapping part seems
> unnecessary.

Ok.

Thanks,
//richard


  reply	other threads:[~2022-03-31  8:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 20:16 [PATCH] Alchemy: Fix rt_task_unblock() for RT_MUTEX Richard Weinberger
2022-03-31  8:25 ` Bezdeka, Florian
2022-03-31  8:36   ` Richard Weinberger [this message]
2022-04-01  7:16     ` Bezdeka, Florian
2022-04-04  9:39       ` Richard Weinberger
2022-04-04 11:20         ` Jan Kiszka
2022-04-04 13:26           ` Richard Weinberger
2022-04-04 11:21 ` Jan Kiszka
2022-04-04 12:17   ` Richard Weinberger
2022-04-04 12:34     ` Jan Kiszka
2022-04-04 12:40       ` Richard Weinberger
2023-01-09 16:25 ` [PATCH v2] " Aaron Marcher
2023-01-10  5:52   ` Jan Kiszka
2023-01-10  7:54     ` Florian Bezdeka
2023-01-10  8:02       ` Jan Kiszka
2023-01-10  8:05         ` Richard Weinberger

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=637249774.202758.1648715778757.JavaMail.zimbra@nod.at \
    --to=richard@nod.at \
    --cc=florian.bezdeka@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.