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
davidxu
58fc7458af
Use umutex APIs to implement pthread_mutex, member pp_mutexq is added
...
into pthread structure to keep track of locked PTHREAD_PRIO_PROTECT mutex,
no real mutex code is changed, the mutex locking and unlocking code should
has same performance as before.
2006-08-28 04:52:50 +00:00
davidxu
77e7cda2cf
Add umutex APIs.
2006-08-28 04:47:27 +00:00
ru
4d582ffe09
Remove alpha left-overs.
2006-08-22 08:03:01 +00:00
davidxu
c8a98491d0
Axe unused member field.
2006-08-08 05:04:43 +00:00
davidxu
cfa46376c7
Get number of CPUs and ignore spin count on single processor machine.
2006-08-08 04:42:41 +00:00
davidxu
5193e44c40
1. Don't override underscore version of aio_suspend(), system(),
...
wait(), waitpid() and usleep(), they are internal versions and
should not be cancellation points.
2. Make wait3() as a cancellation point.
3. Move raise() and pause() into file thr_sig.c.
4. Add functions _sigsuspend, _sigwait, _sigtimedwait and _sigwaitinfo,
remove SIGCANCEL bit in wait-set for those functions, the signal is
used internally to implement thread cancellation.
2006-07-25 12:50:05 +00:00
delphij
36c285d128
Unexpand two TAILQ_FOREACH_SAFE cases.
...
Ok'ed by: davidxu
2006-07-17 09:23:44 +00:00
davidxu
2b1dbc0acb
Caching scheduling policy and priority in userland, a critical but baddly
...
written application is frequently changing thread priority for SCHED_OTHER
policy.
2006-07-13 22:45:19 +00:00
davidxu
19b8418903
Use thr_setscheduler, thr_getscheduler and thr_setschedparam to implement
...
pthread functions.
2006-07-13 06:35:43 +00:00
davidxu
ecacf536b0
Use kernel facilities to support real-time scheduling.
2006-07-12 06:13:18 +00:00
davidxu
f53e1c9383
__error could be called too early before libthr is initialized, test
...
this case and return global varible errno instead.
2006-07-12 03:44:05 +00:00
davidxu
be54fdbbff
Remove unused member.
2006-06-03 00:19:40 +00:00
davidxu
523fcb36a8
Remove unused member field m_queue.
2006-06-02 08:37:01 +00:00
delphij
6e4a34202a
Explicitly request pre-zeroed memory instead of memset'ing our
...
own.
Ok'ed by: davidxu
2006-05-31 00:31:38 +00:00
davidxu
975a6925fe
Add symbol versions: FBSD_1.0 and FBSDprivate.
2006-05-11 07:02:52 +00:00
davidxu
6a9d879cfe
s/long/int.
2006-04-27 08:25:13 +00:00
davidxu
66d0fee031
- Use same priority range returned by kernel's sched_get_priority_min()
...
and sched_get_priority_max() syscalls.
- Remove unused fields from structure pthread_attr.
2006-04-27 08:18:23 +00:00
davidxu
8001df6f90
Remove multiple _get_curthread() calls.
2006-04-23 11:23:37 +00:00
ru
450f399135
Install shared libpthread library into /lib; needed by some
...
/sbin programs.
2006-04-12 19:42:20 +00:00
davidxu
7d0c23506c
Do not check validity of timeout if a mutex can be acquired immediately.
...
Completly drop recursive mutex in pthread_cond_wait and restore recursive
after resumption. Reorganize code to make gcc to generate better code.
2006-04-08 13:24:44 +00:00
davidxu
f921934131
Remove declaration of _thr_initial from MD header file, it is no longer
...
needed.
2006-04-04 03:35:26 +00:00
davidxu
8bff50a485
Simplify _get_curthread() and _tcb_ctor because libc and rtld now
...
already allocate thread pointer space in tls block for initial thread.
Only i386 and amd64 have been done, others still have to be tested.
2006-04-04 03:26:06 +00:00
davidxu
31f2b819c6
WARNS level 4 cleanup.
2006-04-04 02:57:49 +00:00
des
5438ed2ce6
Fix prototype mismatch.
2006-03-28 21:46:55 +00:00
davidxu
255936645e
Remove priority mutex code because it does not work correctly,
...
to make it work, turnstile like mechanism to support priority
propagating and other realtime scheduling options in kernel
should be available to userland mutex, for the moment, I just
want to make libthr be simple and efficient thread library.
Discussed with: deischen, julian
2006-03-27 23:50:21 +00:00
davidxu
4b5909711d
Comment out -g compiler option, found by 'FreeBSD Build Options Survey'.
2006-03-27 05:58:58 +00:00
davidxu
32673f0256
Check cancellation state carefully to see we really need to call
...
_pthread_testcancel(). Preserve errno in _thr_suspend_check().
2006-03-26 01:57:03 +00:00
davidxu
2926ddf5d1
Don't cancel thread if it is in critical region.
2006-03-25 07:03:13 +00:00
davidxu
679e2338c0
Only wake up writer if the lock is free.
2006-03-25 05:14:21 +00:00