How can we extract mutex_control

Saurabh Gadia gadia at usc.edu
Thu Aug 13 08:57:10 UTC 2015


For time being I am calculating it this way:

#define typeaddr(addr, type, member) \
  (type *)((char *)(addr) - offsetof(type, member))

CORE_mutex_Control *the_mutex= typeaddr(holder->Wait.queue,
CORE_mutex_Control, Wait_queue);

Is there any other easy way? Like I guess we maintain objects so is there a
way to get Object from its id. But its again convoluted problem - how to
get id?

Thanks,

Saurabh Gadia

On Thu, Aug 13, 2015 at 12:20 AM, Saurabh Gadia <gadia at usc.edu> wrote:

> Hi,
>
> For a given thread waiting on a mutex, how can we extract the
> mutex_control on which this thread is waiting? For example in
> Thread_Change_priority(). So do the thread_control structure has any
> reference to mutex on which it is blocked?
>
> Thanks,
>
> Saurabh Gadia
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20150813/65f02a5d/attachment-0002.html>


More information about the devel mailing list