Ryan Stone aad93b043a r179417 introduced a bug into pthread_once(). Previously pthread_once()
used a global pthread_mutex_t for synchronization.  r179417 replaced that
with an implementation that directly used atomic instructions and thr_*
syscalls to synchronize callers to pthread_once.  However, calling
pthread_mutex_lock on the global mutex implicitly ensured that
_thr_check_init() had been called but with r179417 this was no longer
guaranteed.  This meant that if you were unlucky enough to have your first
call into libthr be a call to pthread_once(), you would segfault when
trying to access the pointer returned by _get_curthread().

The fix is to explicitly call _thr_check_init() from pthread_once().

Reviewed by:	davidxu
Approved by:	emaste (mentor)
MFC after:	1 week
2011-04-20 14:19:34 +00:00
..
2011-02-27 01:32:10 +00:00
2011-04-09 14:09:46 +00:00
2011-04-14 15:42:15 +00:00
2010-08-03 17:40:09 +00:00
2010-12-04 08:44:56 +00:00
2010-06-13 01:27:29 +00:00
2010-08-03 17:40:09 +00:00
2010-08-03 17:40:09 +00:00