From: Erwin Pranz <erwin.pranz@sigmatek.at>
To: xenomai@xenomai.org
Subject: [Xenomai] Rescnt imbalance in rtdm_mutex_timedlock
Date: Tue, 25 Mar 2014 12:45:16 +0100 [thread overview]
Message-ID: <53316C4C.6000708@sigmatek.at> (raw)
Hello,
I am using rtdm_mutex_lock/rtdm_mutex_unlock in a rtdm driver and I get
a signal SIGDEBUG_MIGRATE_PRIOINV when I call the driver from a
priority-0 thread.The signal is sent in xnsynch_release_thread when
rescnt is 0 on a XNOTHER thread, which means that rescnt is not balanced.
I think the reason why rescnt is not balanced is in
rtdm_mutex_timedlock: when the owner of the mutex is NULL, the owner is
changed to the calling thread, but rescnt is not increased.
I suggest the following fix in rtdm_mutex_timedlock:
- else if (likely(xnsynch_owner(&mutex->synch_base) == NULL))
+ else if (likely(xnsynch_owner(&mutex->synch_base) == NULL)) {
xnsynch_set_owner(&mutex->synch_base, curr_thread);
+ if (xnthread_test_state(curr_thread, XNOTHER))
+ xnthread_inc_rescnt(curr_thread);
+ }
Best regards,
--
Erwin Pranz
Software
________________________________
SIGMATEK GmbH & Co KG
Sigmatekstraße 1
5112 Lamprechtshausen Österreich / Austria
Tel.: +43/6274/4321-0
Fax: +43/6274/4321-18
E-Mail: erwin.pranz@sigmatek.at
http://www.sigmatek-automation.com
next reply other threads:[~2014-03-25 11:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 11:45 Erwin Pranz [this message]
2014-03-26 16:49 ` [Xenomai] Rescnt imbalance in rtdm_mutex_timedlock Henri Roosen
2014-03-26 23:07 ` Gilles Chanteperdrix
2014-03-27 9:41 ` Philippe Gerum
2014-03-27 15:02 ` Henri Roosen
2014-03-27 16:26 ` Philippe Gerum
2014-03-27 18:04 ` Jan Kiszka
2014-03-27 18:24 ` Philippe Gerum
2014-03-27 18:31 ` Jan Kiszka
2014-03-27 18:39 ` Gilles Chanteperdrix
2014-03-27 20:18 ` Lowell Gilbert
2014-03-28 8:32 ` Philippe Gerum
2014-03-27 18:35 ` Gilles Chanteperdrix
2014-03-28 9:52 ` Erwin Pranz
2014-03-28 10:14 ` Philippe Gerum
2014-03-28 11:14 ` Erwin Pranz
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=53316C4C.6000708@sigmatek.at \
--to=erwin.pranz@sigmatek.at \
--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.