From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Xenomai-git Digest, Vol 17, Issue 18
Date: Mon, 23 Aug 2010 12:32:54 +0200 [thread overview]
Message-ID: <4C724E56.7000202@domain.hid> (raw)
In-Reply-To: <mailman.63.1282557625.26045.xenomai-git@xenomai.org>
xenomai-git-request@domain.hid wrote:
> Module: xenomai-2.5
> Branch: master
> Commit: edaf1e2e54343b6e4bf5cf6ece9175ec0ab21cad
> URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=edaf1e2e54343b6e4bf5cf6ece9175ec0ab21cad
>
> Author: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
> Date: Sun Aug 22 15:37:11 2010 +0200
>
> Do not assume that XN_NO_HANDLE is NULL
>
> ---
>
> src/skins/common/current.c | 1 +
> src/skins/native/mutex.c | 4 ++--
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/skins/common/current.c b/src/skins/common/current.c
> index 7f36991..4e75690 100644
> --- a/src/skins/common/current.c
> +++ b/src/skins/common/current.c
> @@ -46,6 +46,7 @@ static inline int create_current_key(void)
>
> static inline void __xeno_set_current(xnhandle_t current)
> {
> + current = (current == XN_NO_HANDLE ? current : (xnhandle_t)(0));
I think you meant "!=" here.
Jan
> pthread_setspecific(xeno_current_key, (void *)current);
> }
>
> diff --git a/src/skins/native/mutex.c b/src/skins/native/mutex.c
> index 55d502f..8e2a57c 100644
> --- a/src/skins/native/mutex.c
> +++ b/src/skins/native/mutex.c
> @@ -76,7 +76,7 @@ static int rt_mutex_acquire_inner(RT_MUTEX *mutex, RTIME timeout, xntmode_t mode
> xnhandle_t cur;
>
> cur = xeno_get_current();
> - if (!cur)
> + if (cur == XN_NO_HANDLE)
> return -EPERM;
>
> if (likely(!(xeno_get_current_mode() & XNRELAX))) {
> @@ -140,7 +140,7 @@ int rt_mutex_release(RT_MUTEX *mutex)
> xnhandle_t cur;
>
> cur = xeno_get_current();
> - if (!cur)
> + if (cur == XN_NO_HANDLE)
> return -EPERM;
>
> if (unlikely(xnsynch_fast_owner_check(mutex->fastlock, cur) != 0))
>
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next parent reply other threads:[~2010-08-23 10:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.63.1282557625.26045.xenomai-git@xenomai.org>
2010-08-23 10:32 ` Jan Kiszka [this message]
2010-08-23 11:09 ` [Xenomai-core] Xenomai-git Digest, Vol 17, Issue 18 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=4C724E56.7000202@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=gilles.chanteperdrix@xenomai.org \
--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.