<div dir="ltr"><div><div>hi,<br><br></div>I was going through the code in _thread_change_priority(){..} (threadchangepriority.c) and had doubt. below is the code snippet.<br><br><br>  _Atomic_Fence( ATOMIC_ORDER_ACQ_REL );<br><br>  /*<br>   *  Do not bother recomputing all the priority related information if<br>   *  we are not REALLY changing priority.<br>   */<br>  if ( ( *filter )( the_thread, &new_priority, arg ) ) {<br>    uint32_t my_generation;<br><br>    my_generation = the_thread->priority_generation + 1;<br>    the_thread->current_priority = new_priority;<b><br>    the_thread->priority_generation = my_generation;</b><br><br>    ( *the_thread->Wait.operations->priority_change )(<br>      the_thread,<br>      new_priority,<br>      the_thread->Wait.queue<br>    );<br><br></div>how is the data race problem avoided while setting the_thread->priority_generation?<br><div><br><br clear="all"><div><div><div><div class="gmail_signature"><div dir="ltr">Thanks,<div><br></div><div>Saurabh Gadia</div></div></div></div>
</div></div></div></div>