Re: libc: prefer _MUTEX_LOCK() over _THREAD_PRIVATE_MUTEX_LOCK()

2016-04-05 Thread Martin Natano
On Mon, Apr 04, 2016 at 07:18:36PM -0700, Philip Guenther wrote: > On Mon, 4 Apr 2016, Martin Natano wrote: > > On Sun, Apr 03, 2016 at 08:20:57PM -0700, Philip Guenther wrote: > ... > > > So, diff below converts several uses of _THREAD_PRIVATE_MUTEX_*() to > > > _MUTEX_*(). Regress tests libc/st

Re: libc: prefer _MUTEX_LOCK() over _THREAD_PRIVATE_MUTEX_LOCK()

2016-04-04 Thread Philip Guenther
On Mon, 4 Apr 2016, Martin Natano wrote: > On Sun, Apr 03, 2016 at 08:20:57PM -0700, Philip Guenther wrote: ... > > So, diff below converts several uses of _THREAD_PRIVATE_MUTEX_*() to > > _MUTEX_*(). Regress tests libc/stdio_threading/* and asr/bin/threads > > still pass with this. > > I think

Re: libc: prefer _MUTEX_LOCK() over _THREAD_PRIVATE_MUTEX_LOCK()

2016-04-04 Thread Martin Natano
On Sun, Apr 03, 2016 at 08:20:57PM -0700, Philip Guenther wrote: > > libc has a number of macros for dealing with thread safety such that it > can operate efficiently when single-threaded but Do The Right Thing when > multi-threaded. In include/thread_private.h are two sets of macros that > lo

libc: prefer _MUTEX_LOCK() over _THREAD_PRIVATE_MUTEX_LOCK()

2016-04-03 Thread Philip Guenther
libc has a number of macros for dealing with thread safety such that it can operate efficiently when single-threaded but Do The Right Thing when multi-threaded. In include/thread_private.h are two sets of macros that look interchangable but that are quite different on the underside. _MUTEX_LO