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
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
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
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
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
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
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
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
davidxu
cba4d932c1
Compile thr_rtld.c
2006-03-25 05:00:54 +00:00
davidxu
6ee36bbb6d
Add locking support for rtld.
2006-03-25 04:49:07 +00:00
davidxu
eb9bdb4259
set an upper limit for thread structures which can be allocated.
2006-03-24 04:34:06 +00:00
davidxu
020594940d
Set default contention scope to system.
2006-03-20 03:14:14 +00:00
davidxu
d119bdaa7a
Remove mqueue and timer, now they are in librt.
2006-03-08 23:47:04 +00:00
deischen
e586a0042e
Add some more pthread stubs so that librt can use them.
...
The thread jump table has been resorted, so you need to
keep libc, libpthread, and libthr in sync.
Submitted by: xu
2006-03-05 18:10:28 +00:00
davidxu
6fdf2b7d81
Reimplement mutex_init to get rid of compile warning.
2006-02-28 06:06:19 +00:00
davidxu
bb43155dbb
Disable POSIX SIGEV_THREAD notification support, soon we will have a common
...
library which can be reused both for libthr and libpthread.
2006-02-22 02:52:22 +00:00
davidxu
91fda076fb
Read cycle count before sending signal, this fixes a userland thread
...
suspension bug.
MFC after: 3 days
2006-02-20 09:02:40 +00:00
davidxu
70ea4e1323
Rework last change of pthread_once, create a function _thr_once_init to
...
reinitialize its internal locks.
2006-02-15 23:05:03 +00:00
davidxu
44a8ce5006
After fork(), reinitialize internal locks for pthread_once().
2006-02-15 13:41:02 +00:00
davidxu
08b1c5c928
Now, thread name is stored in kernel, userland no longer has to keep it.
2006-02-05 03:04:54 +00:00
davidxu
118990614c
use syscall thr_set_name to implement pthread_set_name_np.
2006-02-05 02:26:17 +00:00
davidxu
3172ccca0f
Add missing symbol pthread_set_name_np.
2006-01-23 06:11:23 +00:00
davidxu
97a1cdabb8
Eliminate unused code.
2006-01-16 05:33:48 +00:00