All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: Xenomai core <Xenomai-core@domain.hid>
Subject: Re: [Xenomai-core] [Xenomai-git] Jan Kiszka : Native: Fix return code of in-kernel rt_cond_wait[_until]
Date: Tue, 02 Mar 2010 13:32:02 +0100	[thread overview]
Message-ID: <4B8D0542.1020904@domain.hid> (raw)
In-Reply-To: <4B8D0466.7040403@domain.hid>

Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
>> GIT version control wrote:
>>> Module: xenomai-jki
>>> Branch: for-upstream
>>> Commit: f1dfda551b6997f74141986759932e2723a9f024
>>> URL:    http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=f1dfda551b6997f74141986759932e2723a9f024
>>>
>>> Author: Jan Kiszka <jan.kiszka@domain.hid>
>>> Date:   Tue Mar  2 13:17:35 2010 +0100
>>>
>>> Native: Fix return code of in-kernel rt_cond_wait[_until]
>>>
>>> In rt_cond_wait_inner, do not let rt_cond_wait_epilogue overwrite the
>>> primary error code of rt_cond_wait_prologue. This restores the in-kernel
>>> semantics of rt_cond_wait[_until] that were valid before 97323b3287.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
>>>
>>> ---
>>>
>>>  ksrc/skins/native/cond.c |    8 ++++----
>>>  1 files changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/ksrc/skins/native/cond.c b/ksrc/skins/native/cond.c
>>> index 10727d1..2dc0069 100644
>>> --- a/ksrc/skins/native/cond.c
>>> +++ b/ksrc/skins/native/cond.c
>>> @@ -472,10 +472,10 @@ static int rt_cond_wait_inner(RT_COND *cond, RT_MUTEX *mutex,
>>>  	err = rt_cond_wait_prologue(cond, mutex, &lockcnt, 
>>>  				    timeout_mode, timeout);
>>>  
>>> -	if(!err || err == -ETIMEDOUT || err == -EINTR)
>>> -		do {
>>> -			err = rt_cond_wait_epilogue(mutex, lockcnt);
>>> -		} while (err == -EINTR);
>>> +	if (!err || err == -ETIMEDOUT || err == -EINTR) {
>>> +		while (rt_cond_wait_epilogue(mutex, lockcnt) == -EINTR)
>>> +			; /* empty */
>>> +	}
>> Not ok. If rt_cond_wait_epilogue returns an error other than -EINTR, we
>> want this error to be returned.
> 
> As I said: This is what we used to do in 2.4 (and early 2.5-rc), and due
> to the absence of spec on this topic, I would vote for restoring old
> behavior.

if rt_cond_wait_epilogue returns an error other than -EINTR, there is an
error to be signaled, so, it should be returned to the user, not 0 or
-ETIMEDOUT which would let the user think that he got the mutex back,
whereas the mutex is probably not properly locked.

> 
> Jan
> 


-- 
					    Gilles.


  parent reply	other threads:[~2010-03-02 12:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1NmR5I-0003k9-N5@domain.hid>
2010-03-02 12:23 ` [Xenomai-core] [Xenomai-git] Jan Kiszka : Native: Fix return code of in-kernel rt_cond_wait[_until] Gilles Chanteperdrix
2010-03-02 12:28   ` Jan Kiszka
2010-03-02 12:29     ` Jan Kiszka
2010-03-02 12:32     ` Gilles Chanteperdrix [this message]
2010-03-02 12:33       ` Gilles Chanteperdrix
2010-03-02 12:43         ` Jan Kiszka
2010-03-02 12:48           ` Gilles Chanteperdrix
2010-03-02 12:59             ` Jan Kiszka
2010-03-02 13:04               ` Gilles Chanteperdrix
2010-03-02 13:24                 ` Jan Kiszka
2010-03-02 13:30                   ` Gilles Chanteperdrix
2010-03-02 13:34                     ` Jan Kiszka
2010-03-02 13:38                       ` Gilles Chanteperdrix
2010-03-02 13:44                         ` Jan Kiszka
2010-03-02 13:46                           ` Gilles Chanteperdrix
2010-03-02 14:00                             ` Jan Kiszka
2010-03-02 14:04                               ` Gilles Chanteperdrix
2010-03-02 14:08                                 ` Jan Kiszka
2010-03-02 14:15                                   ` Gilles Chanteperdrix
2010-03-02 14:25                                 ` Gilles Chanteperdrix
2010-03-02 14:43                                   ` Jan Kiszka
2010-03-02 13:40                       ` Jan Kiszka
2010-03-02 13:44                         ` Gilles Chanteperdrix

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=4B8D0542.1020904@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=Xenomai-core@domain.hid \
    --cc=jan.kiszka@domain.hid \
    /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.