From: Philippe Gerum <rpm@xenomai.org>
To: Russell Johnson <russell.johnson@kratosdefense.com>
Cc: "xenomai@lists.linux.dev" <xenomai@lists.linux.dev>
Subject: Re: Sleep while holding a mutex
Date: Sat, 16 Jul 2022 12:22:22 +0200 [thread overview]
Message-ID: <87o7xpqrsu.fsf@xenomai.org> (raw)
In-Reply-To: <PH1P110MB10502D67A603D43F701FB193E28B9@PH1P110MB1050.NAMP110.PROD.OUTLOOK.COM>
Russell Johnson <russell.johnson@kratosdefense.com> writes:
> [[S/MIME Signed Part:Undecided]]
> In one of my functions, I lock a mutex, call evl_timedwat_event(), and then unlock the mutex. Whenever I call the timedwait, I get an error from the EVL Core saying that there was a sleep while holding a mutex. I was following the example on [1]. I also noticed under a test at [2] that there is a comment saying to disable the T_WOLI mode on the thread because there will be a sleep during a mutex. The test appears to verify the timedwait
> call. So do I need to just ignore that error whenever I am using an EVL event? Or do I have something else going wrong potentially?
>
>
>
> [1] https://evlproject.org/core/user-api/event/
>
> [2] https://source.denx.de/Xenomai/xenomai4/libevl/-/blob/next/tests/monitor-event.c#L40
>
>
>
> Thanks,
>
>
>
> Russell
>
> [[End of S/MIME Signed Part]]
The documentation is right, but the code is wrong. This patch fixes it:
https://source.denx.de/Xenomai/xenomai4/linux-evl/-/commit/1dc0d91aa3a5c2055fe8e492df0b229546d4f5da
The test suite was updated accordingly to check the right behavior:
https://source.denx.de/Xenomai/xenomai4/libevl/-/commit/1b30808a6b0095736c5e1059377e2cb07225e9f6
--
Philippe.
next prev parent reply other threads:[~2022-07-16 10:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 16:31 Sleep while holding a mutex Russell Johnson
2022-07-16 10:22 ` Philippe Gerum [this message]
2022-07-18 16:28 ` [External] - " Russell Johnson
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=87o7xpqrsu.fsf@xenomai.org \
--to=rpm@xenomai.org \
--cc=russell.johnson@kratosdefense.com \
--cc=xenomai@lists.linux.dev \
/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.