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: "'Boris V. Guzhov'" <borg at int dot spb dot ru>
- Subject: RE: [ECOS] how to get mutex owner?
- From: Fabrice Gautier <Fabrice_Gautier at sdesigns dot com>
- Date: Thu, 3 Aug 2000 10:14:32 -0700
- Cc: ecos-discuss at sourceware dot cygnus dot com
> -----Original Message-----
> From: Boris V. Guzhov [mailto:borg@int.spb.ru]
> Subject: Re: [ECOS] how to get mutex owner?
>
> 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
> }
I'm in plain C. So I don't think this type conversion is very good. It
should work in C++ maybe.
But instead I finally used:
if ( mutex.owner->unique_id == cyg_thread_self() )
Thanks
A+
--
Fabrice Gautier
fabrice_gautier@sdesigns.com