This is the mail archive of the ecos-discuss@sources.redhat.com 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]

Re: how to get mutex owner?




> 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




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