Re: Unexpected value-at for NULL'd pointer with pthreads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21 August 2015 at 19:25, Jeffrey Walton wrote:
> From the sounds of it, it sounds like its the same issue that used to
> occur with the double-checked locking initialization pattern. See, for
> example, http://preshing.com/20130930/double-checked-locking-is-fixed-in-cpp11/.

Except that nothing is read outside the critical section guarded by the mutex.

> If this is the case, then use a memory barrier to ensure the write
> completes after setting the pointer to NULL.

pthread_mutex_unlock should be a release operation and
pthread_mutex_lock should be an acquire operation.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux