Hi Hirofumi, On Sun, Mar 20, 2016 at 3:09 PM, OGAWA Hirofumi <hirof...@mail.parknet.co.jp> wrote: > > I see. Then another candidate is the following. > > pthread_mutex_lock(¬ifierInitMutex); > pthread_mutex_lock(¬ifierMutex); > pthread_cond_wait(¬ifierCV, ¬ifierMutex); > pthread_mutex_unlock(¬ifierMutex); > pthread_mutex_unlock(¬ifierInitMutex); > > Because notifierCV is protected by notifierMutex in other places > (StartNotifierThread and NotifierThreadProc). So without notifierMutex > lock, it would be wrong way (has possibility of race).
You're right, notifierCV is to be protected by notifierMutex, so this idea for the fix looks much better. As far as I can see, you've posted the patch to the upstream bugtracker, thank you. Let's then wait a bit for the Tcl developers answer. Cheers! -- Sergei Golovan