<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Concurrent call to glClientWaitSync results in segfault in one of the waiters."
   href="https://bugs.freedesktop.org/show_bug.cgi?id=98172#c36">Comment # 36</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Concurrent call to glClientWaitSync results in segfault in one of the waiters."
   href="https://bugs.freedesktop.org/show_bug.cgi?id=98172">bug 98172</a>
              from <span class="vcard"><a class="email" href="mailto:shinji.suzuki@gmail.com" title="Suzuki, Shinji <shinji.suzuki@gmail.com>"> <span class="fn">Suzuki, Shinji</span></a>
</span></b>
        <pre>Michel-san, thank you for elaboration. Maybe this discussion continues because
I have failed to express my question clearly. What I'm wondering is that if the
following section needs to be protected by ctx->Shared->Mutex or not.

   screen->fence_reference(screen, &fence, so->fence);
   if(!fence) {
      /* If the so->fence has been reset to NULL, the fence have been reached   
         but so->b.StatusFlag may not be set to GL_TRUE yet. Since the caller   
         may check on the value of the flag as soon as the control returns,     
         do the same too although redundant.                                    
      */
      so->b.StatusFlag = GL_TRUE;
      goto quit;
   }

I completely agree that locking is needed in the following section marked with
!.
(so->b.StatusFlag = GL_TRUE can be moved out of the block though.)

    if (screen->fence_finish(screen, fence, 0)) {
!      mtx_lock(&ctx->Shared->Mutex);                                           
!      screen->fence_reference(screen, &so->fence, NULL);                       
!      so->b.StatusFlag = GL_TRUE;                                              
!      mtx_unlock(&ctx->Shared->Mutex);                                         
    }</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>