From: Philippe Gerum <rpm@xenomai.org>
To: Niklaus Giger <niklaus.giger@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] xenomai-solo-vxWorks: Calling semGive twice on a binary semaphore should not return an error
Date: Mon, 22 Sep 2008 16:49:01 +0200 [thread overview]
Message-ID: <48D7B05D.5060101@domain.hid> (raw)
In-Reply-To: <200809212226.14177.niklaus.giger@domain.hid>
Niklaus Giger wrote:
> Hi
>
> Examining errors in my big testsuite I discovered that giving a second
> time a binary semaphore xenomai returns an error where vxWorks reports OK.
>
Thanks for reporting. That patch should fix this issue:
diff --git a/vxworks/semLib.c b/vxworks/semLib.c
index 62f9326..6467354 100644
--- a/vxworks/semLib.c
+++ b/vxworks/semLib.c
@@ -104,8 +104,11 @@ static STATUS xsem_give(struct wind_sem *sem)
if (syncobj_lock(&sem->u.xsem.sobj, &syns))
return S_objLib_OBJ_ID_ERROR;
- if (sem->u.xsem.value >= sem->u.xsem.maxvalue)
- ret = S_semLib_INVALID_OPERATION;
+ if (sem->u.xsem.value >= sem->u.xsem.maxvalue) {
+ if (sem->u.xsem.maxvalue == INT_MAX)
+ /* No wrap around. */
+ ret = S_semLib_INVALID_OPERATION;
+ }
else if (++sem->u.xsem.value <= 0)
syncobj_post(&sem->u.xsem.sobj);
> See the attached test case.
>> sudo ../../bin/BSys/mak/xeno_vx-solo/debug/tst
>> assert passed at testTask line 65
>> assert passed at testTask line 66
>> assert failed at testTask line 67
>> testTask done
>> Xenomai/SOLO: failed to remove registry mount point /mnt/xenomai/4569
>> (errno=16)
>
> Best regards
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
--
Philippe.
next prev parent reply other threads:[~2008-09-22 14:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-21 20:26 [Xenomai-core] xenomai-solo-vxWorks: Calling semGive twice on a binary semaphore should not return an error Niklaus Giger
2008-09-22 14:49 ` Philippe Gerum [this message]
2008-09-22 17:59 ` Niklaus Giger
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=48D7B05D.5060101@domain.hid \
--to=rpm@xenomai.org \
--cc=niklaus.giger@domain.hid \
--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.