This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Task waiting for a semaphore
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Emmanuel Coullien <coullien dot emmanuel at gmail dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Thu, 16 Oct 2008 11:33:19 +0200
- Subject: Re: [ECOS] Task waiting for a semaphore
- References: <3fae21000810160158w69c611d8ya43bc9b1b9613da2@mail.gmail.com>
On Thu, Oct 16, 2008 at 10:58:38AM +0200, Emmanuel Coullien wrote:
> Hi,
>
> Is someone know how to get an eCos task list which is waiting for a semaphore ?
> In fact, I have several tasks (more than 20) which use the same
> semaphore and at a certain time, I want to know which task is waiting
> this semaphore for debug.
> I don't see anything in the kernel which allow to get this information.
> Is someone have an idea how to do this ?
There is no API for this, but you can access the information yourself
with a little bit of C++ code. Each semaphore as a
Cyg_ThreadQueue queue
which is a linked list of threads waiting on the semaphore. Just walk
the list.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss