All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Problems with mutex
@ 2005-11-30 12:21 Kai Moritz
  2005-11-30 12:29 ` Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Kai Moritz @ 2005-11-30 12:21 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

Hello folks,

I'm using Xenomai 2.0.1 with Linux 2.6.14 and ipipe. I've a strange 
problem using mutex-locks. Repeted calls to rt_mutex_lock with 
TM_NONBLOCK on the same mutex return always 0, which means lock 
successfully aquired, if I understand the API-documentation right.
I've attached a small programm to test that behavior and the 
log-messages it produces on my machine. Perhaps anyone has a hint, what 
I'm doing wrong...

Greetings Kai Moritz

[-- Attachment #2: mutex.tgz --]
[-- Type: application/x-gtar, Size: 1759 bytes --]

[-- Attachment #3: messages --]
[-- Type: text/plain, Size: 2250 bytes --]

Nov 29 19:35:47 localhost kernel: mutex: module initialization... mutex: creating mutex... done!
Nov 29 19:35:47 localhost kernel: mutex: initializing test thread... done.
Nov 29 19:35:47 localhost kernel: mutex: starting rt timer (one shot mode)... done.
Nov 29 19:35:47 localhost kernel: mutex: starting test thread... 
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the  0th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the  1th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the  2th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the  3th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the  4th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the  5th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the  6th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the  7th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the  8th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the  9th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the 10th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the 11th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the 12th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the 13th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the 14th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the 15th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the 16th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the 17th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the 18th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: locking mutex the 19th time...done: 0!
Nov 29 19:35:47 localhost kernel: mutex: all tests done!
Nov 29 19:35:47 localhost kernel: mutex: test thread successfully started.
Nov 29 19:35:47 localhost kernel: mutex: module initialization done.
Nov 29 19:35:47 localhost kernel: mutex: deleting mutex... done!
Nov 29 19:35:47 localhost kernel: mutex: module cleanup done.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xenomai-help] Problems with mutex
  2005-11-30 12:21 [Xenomai-help] Problems with mutex Kai Moritz
@ 2005-11-30 12:29 ` Jan Kiszka
  2005-11-30 12:53   ` Kai Moritz
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2005-11-30 12:29 UTC (permalink / raw)
  To: kai.m.moritz; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 658 bytes --]

Kai Moritz wrote:
> Hello folks,
> 
> I'm using Xenomai 2.0.1 with Linux 2.6.14 and ipipe. I've a strange
> problem using mutex-locks. Repeted calls to rt_mutex_lock with
> TM_NONBLOCK on the same mutex return always 0, which means lock
> successfully aquired, if I understand the API-documentation right.
> I've attached a small programm to test that behavior and the
> log-messages it produces on my machine. Perhaps anyone has a hint, what
> I'm doing wrong...

Does the same thread lock this mutex over and over again (I did not look
at your code yet)? If so, note that mutexes can be acquired recursively
by the original owner.

Jan



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xenomai-help] Problems with mutex
  2005-11-30 12:29 ` Jan Kiszka
@ 2005-11-30 12:53   ` Kai Moritz
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Moritz @ 2005-11-30 12:53 UTC (permalink / raw)
  To: xenomai

Jan Kiszka schrieb:
> 
> Does the same thread lock this mutex over and over again (I did not look
> at your code yet)? If so, note that mutexes can be acquired recursively
> by the original owner.
>
Oh, yes!
That's the solution. I read over that in the API.

Thanks for the quick answer :)

Kai


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-30 12:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-30 12:21 [Xenomai-help] Problems with mutex Kai Moritz
2005-11-30 12:29 ` Jan Kiszka
2005-11-30 12:53   ` Kai Moritz

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.