This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: how to get mutex owner?
- To: "Fabrice Gautier" <Fabrice_Gautier at sdesigns dot com>
- Subject: Re: [ECOS] how to get mutex owner?
- From: "Boris V. Guzhov" <borg at int dot spb dot ru>
- Date: Thu, 3 Aug 2000 10:55:56 +0400
- Cc: <ecos-discuss at sourceware dot cygnus dot com>
- References: <21DDE8E5343ED411840A00A0CC334020104817@EXCHANGE5_5>
> Hi,
>
> I'm trying to access the owner of a mutex. I'm working in C only.
>
> The mutex struct is not documented but I saw in source code that there was
a
> owner field. Unfortunately the type of this field is "cyg_thread" and I
> didn't find any docuementation for this thread structure. And I can't find
> it in the source neither.
Hi,
I think that following code is true.
cyg_mutex_t mutex;
...
if ( mutex.owner == (cyg_thread *)cyg_thread_self() )
{
// This thread is the mutex owner
}
Boris Guzhov,
St.Petersburg, Russia