This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Task waiting for a semaphore


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]