<div dir="ltr"><div>For time being I am calculating it this way:<br><br>#define typeaddr(addr, type, member) \<br>  (type *)((char *)(addr) - offsetof(type, member))<br><br>CORE_mutex_Control *the_mutex= typeaddr(holder->Wait.queue, CORE_mutex_Control, Wait_queue);<br><br></div>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?<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">Thanks,<div><br></div><div>Saurabh Gadia</div></div></div></div>
<br><div class="gmail_quote">On Thu, Aug 13, 2015 at 12:20 AM, Saurabh Gadia <span dir="ltr"><<a href="mailto:gadia@usc.edu" target="_blank">gadia@usc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br><br></div>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?<br><div><div><div><div><br clear="all"><div><div><div dir="ltr">Thanks,<div><br></div><div>Saurabh Gadia</div></div></div></div>
</div></div></div></div></div>
</blockquote></div><br></div>