1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-17 15:27:36 +00:00
freebsd/lib/libthr/thread
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
..
Makefile.inc Introduce a non-portable function pthread_getthreadid_np(3) to retrieve 2011-02-07 21:26:46 +00:00
thr_affinity.c
thr_attr.c
thr_autoinit.c
thr_barrier.c
thr_barrierattr.c
thr_cancel.c
thr_clean.c
thr_concurrency.c
thr_cond.c Because sleepqueue may still being used, we should always check wchan with 2011-01-04 05:35:19 +00:00
thr_condattr.c
thr_create.c Implement the __pthread_map_stacks_exec() for libthr. 2011-01-09 12:38:40 +00:00
thr_detach.c
thr_equal.c
thr_event.c
thr_exit.c
thr_fork.c
thr_getcpuclockid.c
thr_getprio.c
thr_getschedparam.c
thr_getthreadid_np.c Introduce a non-portable function pthread_getthreadid_np(3) to retrieve 2011-02-07 21:26:46 +00:00
thr_info.c
thr_init.c MFp4: 2010-12-22 05:01:52 +00:00
thr_join.c
thr_kern.c MFp4: 2010-12-22 05:01:52 +00:00
thr_kill.c
thr_list.c MFp4: 2010-12-22 05:01:52 +00:00
thr_main_np.c
thr_multi_np.c
thr_mutex.c Return 0 instead of garbage value. 2011-01-06 08:13:30 +00:00
thr_mutexattr.c
thr_once.c r179417 introduced a bug into pthread_once(). Previously pthread_once() 2011-04-20 14:19:34 +00:00
thr_printf.c
thr_private.h Implement the __pthread_map_stacks_exec() for libthr. 2011-01-09 12:38:40 +00:00
thr_pspinlock.c
thr_resume_np.c
thr_rtld.c Implement the __pthread_map_stacks_exec() for libthr. 2011-01-09 12:38:40 +00:00
thr_rwlock.c
thr_rwlockattr.c
thr_self.c
thr_sem.c
thr_setprio.c
thr_setschedparam.c
thr_sig.c Fix a typo. 2011-01-11 01:57:02 +00:00
thr_single_np.c
thr_sleepq.c Add sleep queue code. 2010-12-22 05:03:24 +00:00
thr_spec.c
thr_spinlock.c
thr_stack.c For the process that already loaded libthr but still not initialized 2011-01-10 16:10:25 +00:00
thr_suspend_np.c
thr_switch_np.c
thr_symbols.c
thr_syscalls.c
thr_umtx.c MFp4: 2010-12-22 05:01:52 +00:00
thr_umtx.h MFp4: 2010-12-22 05:01:52 +00:00
thr_yield.c