opnsense-src/lib/libthr/thread
Andrew Turner 20fe2c9465 Merge all the copies of _tcb_ctor and _tcb_dtor.
The amd64, i386, and sparc64 versions were identical, with the one
difference where the former two used inline asm instead of _tcb_get. I
have compared the function before and after replacing the asm with _tcb_get
and found the object files to be identical.

The arm, mips, and powerpc versions were almost identical. The only
difference was the powerpc version used an alignment of 1 where arm and
mips used 16. As this is an increase in alignment is will be safe.

Along with this arm, mips, and powerpc all passed, when initial was true,
the value returned from _tcb_get as the first argument to
_rtld_allocate_tls. This would then return this pointer back to the caller.
We can remove these extra calls by checking if initial is set and setting
the thread control block directly. As this is what the sparc64 code does
we can use it directly.

As after these observations all the architectures can now have identical
code we can merge them into a common file.

Differential Revision:	https://reviews.freebsd.org/D1556
Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
2015-01-21 16:41:05 +00:00
..
Makefile.inc Merge all the copies of _tcb_ctor and _tcb_dtor. 2015-01-21 16:41:05 +00:00
thr_affinity.c Don't compare thread pointers again. 2010-09-13 11:58:42 +00:00
thr_attr.c Use sysctl kern.sched.cpusetsize to retrieve size of kernel cpuset. 2010-11-02 02:13:13 +00:00
thr_autoinit.c Make WARNS2 clean. The fixes mostly included: 2003-05-23 09:48:20 +00:00
thr_barrier.c When destroying a barrier, waiting all threads exit the barrier, 2012-03-16 04:35:52 +00:00
thr_barrierattr.c WARNS level 4 cleanup. 2006-04-04 02:57:49 +00:00
thr_cancel.c The SUSv4tc1 requires that pthread_setcancelstate() shall be not a 2013-06-19 04:47:41 +00:00
thr_clean.c Only access unwind_disabled when _PTHREAD_FORCED_UNWIND is defined. 2010-09-25 09:43:24 +00:00
thr_concurrency.c WARNS level 4 cleanup. 2006-04-04 02:57:49 +00:00
thr_cond.c Fix typo in a comment. 2014-09-02 18:21:19 +00:00
thr_condattr.c Coalesce one more broken line. 2010-05-24 13:44:39 +00:00
thr_create.c Fix known issues which blow up the process after dlopen("libthr.so") 2015-01-03 18:38:46 +00:00
thr_ctrdtr.c Merge all the copies of _tcb_ctor and _tcb_dtor. 2015-01-21 16:41:05 +00:00
thr_detach.c Convert thread list lock from mutex to rwlock. 2010-09-13 07:03:01 +00:00
thr_equal.c Remove 3rd clause, renumber, ok per email 2007-01-12 07:26:21 +00:00
thr_event.c Allow psaddr_t to be widened by using thr_pread_{int,long,ptr}, 2008-09-14 16:07:21 +00:00
thr_exit.c Revert r274772: it is not valid on MIPS 2014-11-25 03:50:31 +00:00
thr_fork.c Fix known issues which blow up the process after dlopen("libthr.so") 2015-01-03 18:38:46 +00:00
thr_getcpuclockid.c Implement syscall clock_getcpuclockid2, so we can get a clock id 2012-08-17 02:26:31 +00:00
thr_getprio.c Remove 3rd clause, renumber, ok per email 2007-01-12 07:26:21 +00:00
thr_getschedparam.c Don't forget to initialize return value. 2012-07-20 05:47:12 +00:00
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 Simplify code by replacing _thr_ref_add() with _thr_find_thread(). 2012-07-20 03:37:19 +00:00
thr_init.c Fix known issues which blow up the process after dlopen("libthr.so") 2015-01-03 18:38:46 +00:00
thr_join.c Fix typo. 2010-09-19 08:55:36 +00:00
thr_kern.c libthr: Always use the threaded rtld lock implementation. 2013-01-18 23:08:40 +00:00
thr_kill.c In _pthread_kill(), if passed pthread is current thread, do not send 2014-02-01 18:13:18 +00:00
thr_list.c Make code more stable by checking NULL pointers. 2012-02-11 04:12:12 +00:00
thr_main_np.c WARNS level 4 cleanup. 2006-04-04 02:57:49 +00:00
thr_multi_np.c Remove 3rd clause, renumber, ok per email 2007-01-12 07:26:21 +00:00
thr_mutex.c MFp4: 2012-08-11 23:17:02 +00:00
thr_mutexattr.c pthread_mutexattr_destroy() was accidentally broken in last revision, 2008-03-20 11:47:08 +00:00
thr_once.c r179417 introduced a bug into pthread_once(). Previously pthread_once() 2011-04-20 14:19:34 +00:00
thr_printf.c Fix known issues which blow up the process after dlopen("libthr.so") 2015-01-03 18:38:46 +00:00
thr_private.h Merge all the copies of _tcb_ctor and _tcb_dtor. 2015-01-21 16:41:05 +00:00
thr_pspinlock.c Reverse the logic of UP and SMP. 2007-10-16 07:36:02 +00:00
thr_resume_np.c In suspend_common(), don't wait for a thread which is in creation, because 2012-08-27 03:09:39 +00:00
thr_rtld.c Right now, the rtld prefork hook locks the rtld bind lock in the read 2014-05-24 10:23:06 +00:00
thr_rwlock.c Follow changes made in revision 232144, pass absolute timeout to kernel, 2012-02-27 13:38:52 +00:00
thr_rwlockattr.c Revert revision 214007, I realized that MySQL wants to resolve 2010-10-20 02:34:02 +00:00
thr_self.c Remove 3rd clause, renumber, ok per email 2007-01-12 07:26:21 +00:00
thr_sem.c Use umtx to implement process sharable semaphore, to make this work, 2010-01-05 02:37:59 +00:00
thr_setprio.c Don't assign same value. 2012-07-20 03:22:17 +00:00
thr_setschedparam.c Don't assign same value. 2012-07-20 03:22:17 +00:00
thr_sig.c Fix bug in r276630. Do not allow pthread_sigmask() to block SIGCANCEL. 2015-01-21 16:13:37 +00:00
thr_single_np.c Remove 3rd clause, renumber, ok per email 2007-01-12 07:26:21 +00:00
thr_sleepq.c Create a common function lookup() to search a chan, this eliminates 2012-05-10 09:30:37 +00:00
thr_spec.c Return one-based key so that user can check if the key is ever allocated 2013-05-16 03:01:04 +00:00
thr_spinlock.c Avoid various shadowed variables. libthr is now almost WARNS=4 clean except 2008-04-23 21:06:51 +00:00
thr_stack.c Add a knob LIBPTHREAD_BIGSTACK_MAIN, which instructs libthr to leave 2014-08-13 05:53:41 +00:00
thr_suspend_np.c In suspend_common(), don't wait for a thread which is in creation, because 2012-08-27 03:09:39 +00:00
thr_switch_np.c WARNS level 4 cleanup. 2006-04-04 02:57:49 +00:00
thr_symbols.c Remove 3rd clause, renumber, ok per email 2007-01-12 07:26:21 +00:00
thr_syscalls.c Reduce the size of the interposing table and amount of 2015-01-11 22:16:31 +00:00
thr_umtx.c Use clockid parameter instead of hard-coded CLOCK_REALTIME. 2012-03-19 00:07:10 +00:00
thr_umtx.h libthr: Fix a parameter name in an internal header file. 2013-04-27 14:21:36 +00:00
thr_yield.c Remove 3rd clause, renumber, ok per email 2007-01-12 07:26:21 +00:00