Commit Graph

309 Commits

Author SHA1 Message Date
ru
08a6766d3a Always install libpthread.* symlinks if at least one of
the threading libraries is built.  This simplifies the
logic in makefiles that need to check if the pthreads
support is present.  It also fixes a bug where we would
build a threading library that we shouldn't have built:
for example, building with WITHOUT_LIBTHR and the default
value of DEFAULT_THREADING_LIB (libthr) would mistakenly
build the libthr library, but not install it.

Approved by:	re (kensmith)
2007-10-01 18:29:55 +00:00
davidxu
52bd1282cd Output error message to STDERR_FILENO.
Approved by: re (bmah)
2007-08-07 04:50:14 +00:00
davidxu
abf8c6f8db Set warning level to 2. 2007-06-08 02:21:13 +00:00
deischen
ff36458e08 Bump library versions in preparation for 7.0.
Ok'd by:	kan
2007-05-21 02:49:08 +00:00
ru
3be5d73f3d Fix a logic bug I re-introduced in my patch I sent to Daniel
that would cause the selected shared threading library to be
overwritten with its 32-bit version on amd64.

PR:		amd64/112509
2007-05-18 12:25:48 +00:00
deischen
7d5de3a8a3 Allow DEFAULT_THREAD_LIB to be set from /etc/src.conf.
Submitted by:	ru
2007-05-17 04:54:35 +00:00
deischen
bf3a79274d Enable symbol versioning by default. Use WITHOUT_SYMVER to disable it.
Warning, after symbol versioning is enabled, going back is not easy
(use WITHOUT_SYMVER at your own risk).

Change the default thread library to libthr.

There most likely still needs to be a version bump for at least the
thread libraries.  If necessary, this will happen later.
2007-05-13 14:12:40 +00:00
davidxu
d97c4f1e52 backout experimental adaptive spinning mutex for product use. 2007-05-09 08:39:33 +00:00
deischen
2a7306fdc5 Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
davidxu
2dd85eafce If a thread who's name is being set is not the current thread, use macros
THR_THREAD_LOCK and THR_THREAD_UNLOCK instead, this should fix wrong
lock level problem.

Bug reported by: ed dot maste at gmail dot com
2007-04-05 07:20:31 +00:00
imp
9109b1ceb8 Remove 3rd clause, renumber, ok per email 2007-01-12 07:26:21 +00:00
davidxu
9770c4c640 Insert mutex at tail if it has highest ceiling. 2007-01-05 03:57:11 +00:00
davidxu
dec2b546dd Oops, don't corrupt the list. 2007-01-05 03:33:47 +00:00
davidxu
190109deab Check if the PP mutex is recursive, if we have already locked it, place the
mutex in right order sorted by priority ceiling.
2007-01-05 03:29:15 +00:00
davidxu
d305995d66 get LIBPTHREAD_ADAPTIVE_SPIN early, so it can be used for some global
mutexes.
2006-12-20 05:05:44 +00:00
davidxu
e034ab54f2 Check environment variable PTHREAD_ADAPTIVE_SPIN, if it is set, use
it as a default spin cycle count.
2006-12-20 04:43:34 +00:00
davidxu
ca27871833 - Remove variable _thr_scope_system, all threads are system scope.
- Rename _thr_smp_cpus to boolean variable _thr_is_smp.
- Define CPU_SPINWAIT macro for each arch, only X86 supports it.
2006-12-15 11:52:01 +00:00
davidxu
26cbb63b3f Create inline function _thr_umutex_trylock2 to only try one atomic
operation, if it is failed, we call syscall directly, this saves
one atomic operation per lock contention.
2006-12-14 13:22:02 +00:00
davidxu
229aca4634 Correctly check failed syscall. 2006-12-12 05:26:39 +00:00
davidxu
fcda4340a4 Move checking for c_has_waiters into low level _thr_ucond_signal and
_thr_ucond_broadcast, clear condition variable pointer in cancellation
info after returing from _thr_ucond_wait, since kernel has already
dropped the internal lock, so we don't need to unlock it in cancellation
handler again.
2006-12-12 03:08:49 +00:00
davidxu
33168bd24f test cancel_pending to save a thr_wake call in some specical cases. 2006-12-06 00:15:35 +00:00
davidxu
b01e86cf0a _thr_ucond_wait drops lock, we should pick it up again. 2006-12-05 23:46:11 +00:00
davidxu
3f73376426 the c_has_waiters is lazily updated, temporarily disable the false
alarm code.
2006-12-05 07:23:58 +00:00
davidxu
f26900460b Use ucond to implement barrier. 2006-12-05 06:54:25 +00:00
davidxu
f1f5293365 Add _thr_ucond_init(). 2006-12-05 06:53:44 +00:00
davidxu
19c999e75f Tweak _thr_cancel_leave_defer a bit to fix a possible race. 2006-12-05 05:01:57 +00:00
davidxu
5ad129a10a Fix typo, I was using a wrong header file, and the typo is not detected
by compiler.
2006-12-04 14:27:42 +00:00
davidxu
cbb0fd8174 Use kernel provided userspace condition variable to implement pthread
condition variable.
2006-12-04 14:20:41 +00:00
davidxu
61e0842016 If a thread was detached, return EINVAL instead, the error code
is also returned by pthread_detach() if a thread was already
detached, the error code was already documented:

>    [EINVAL]	The implementation has detected that the value speci-
>		fied by thread does not refer to a joinable thread.
2006-11-28 11:05:31 +00:00
ru
815d860c2f - When building world WITHOUT_LIBPTHREAD, link libthr to libpthread.
- Don't build ngctl(8) and cached(8) if threading libs aren't built.
- Fix various issues in a cached(8) makefile.
2006-11-26 14:36:34 +00:00
davidxu
add205129c Eliminate atomic operations in thread cancellation functions, it should
reduce overheads of cancellation points.
2006-11-24 09:57:38 +00:00
davidxu
cc0840138e Move code calculating new inherited priority into single function. 2006-11-11 13:33:47 +00:00
davidxu
e8a2970aaf Don't inherit THR_FLAGS_NEED_SUSPEND for child process, child process
only has one thread, setting the flag can cause the thread to be
suspended and no another thread will resume it.
2006-10-14 13:40:08 +00:00
davidxu
653013bedc o Make _thr_umutex_init a function.
o Eliminate unused parameter for some functions.
o Convert type of first parameter to void * for _thr_umtx_wait
  and _thr_umtx_wake.
2006-10-13 22:31:00 +00:00
davidxu
4fdad8dba6 Use type pthread_state for thread state. 2006-10-13 12:45:21 +00:00
davidxu
d2c57b7fad use rtprio_thread system call to get or set thread priority. 2006-09-21 04:21:30 +00:00
davidxu
e83ab88356 Use return value of _thr_umutex_lock instead of using zero. 2006-09-08 09:29:14 +00:00
davidxu
21e4536026 Replace internal usage of struct umtx with umutex which can supports
real-time if we want, no functionality is changed.
2006-09-06 04:04:10 +00:00
davidxu
567ba06917 Same as pthread_setschedparam, use sizeof(struct sched_param) instead. 2006-09-05 14:39:06 +00:00
davidxu
5b28602728 Pass correct parameter size. 2006-09-05 14:37:22 +00:00
marcel
d21513035e Stylize: avoid using a global register variable. 2006-09-01 21:01:11 +00:00
marcel
2d71eb396a Rename TLS_TP_OFFSET back to TP_OFFSET. The former clashes with rtld. 2006-09-01 06:36:00 +00:00
marcel
1125db3243 Stylize. 2006-09-01 06:15:00 +00:00
marcel
6a1762d589 Stylize. 2006-08-31 23:31:18 +00:00
marcel
5ffd88a18e TLS fixes:
o  The TLS pointer (r2) points 0x7000 after the *end* of the TCB.
o  _rtld_allocate_tls() gets a pointer to the current TCB, not the
   current TLS pointer.
o  _rtld_free_tls() gets the size of the TCB structure.
2006-08-31 19:16:47 +00:00
marcel
c088f26c25 Fix harmless bug: sizeof(tcb) equals sizeof(void*) not sizeof(struct tcb).
The argument is (currently) not used by _rtld_free_tls().
2006-08-31 19:06:30 +00:00
marcel
4736b1fdce o Set TP using inline assembly to avoid dead code elimination.
o  Eliminate _tcb.
2006-08-30 03:31:32 +00:00
davidxu
37473cc569 Remove unused file. 2006-08-29 13:01:23 +00:00
davidxu
faa99f1910 pthread_sigmask is in thr_sig.c, remove this file. 2006-08-28 12:29:54 +00:00
davidxu
b7dde83f82 Kill unused files. 2006-08-28 05:01:31 +00:00