ad
ecdd2c2965
Cheat and add inlines for _atomic_cas_ptr() to work around gcc emitting
...
unneeded PIC stuff in mutex_lock() and mutex_unlock(), when a thread
register is used.
2008-03-22 17:59:12 +00:00
ad
783e2f6db5
Back out previous. It seems to expose another bug in libpthread/libc,
...
potentially errno being used before threading is up and running.
2008-03-22 14:19:27 +00:00
ad
159f554369
Move pthread__errno() into pthread_specific.c so it gets the "no stack
...
frame" treatment.
2008-03-21 21:35:43 +00:00
rmind
2ac12931eb
Add sched(3) manual page, and appropriate links.
...
Thanks <wiz> for review and fixes!
2008-03-10 14:47:06 +00:00
ad
61f666ba09
_pthread_rwlock_held_np: if write locked, only return true if held by
...
the current thread.
2008-03-08 13:46:59 +00:00
ad
eceac52f08
Complain if _lwp_ctl() fails.
2008-03-08 13:23:13 +00:00
ad
8b2c109b14
Add a cast to make lint happy.
2008-03-08 13:22:22 +00:00
ad
55faac1242
pthread_key_create: instead of using a simple 1/0 value to record a key
...
as allocated, use an array of pointers and save __builtin_return_address(0)
so keys can be identified when doing post-mortem debugging.
2008-03-07 22:27:07 +00:00
ad
8548e33886
pthread__mutex_lock_slow:
...
- don't stop spinning if there are already waiters on the mutex, there is
no point.
- cosmetic change.
2008-03-07 22:23:57 +00:00
ad
6869216239
Fix pthread_mutex_trylock() for recursive mutexes. PR lib/38087.
...
Based on a patch provided by rafal@.
2008-02-23 15:15:57 +00:00
ad
377f098ab0
Adjust mutex/rwlock definitions to match reality now that there is only
...
one implementation of each. PR lib/38030.
2008-02-14 21:40:51 +00:00
ad
a67e1e3475
- Remove libpthread's atomic ops.
...
- Remove the old spinlock-based mutex and rwlock implementations.
- Use the atomic ops from libc.
2008-02-10 18:50:54 +00:00
ad
9c43df3853
We've got the priority/class stuff now.
2008-02-10 14:52:05 +00:00
yamt
603e4b9abd
update for _sched_{get,set}param changes. from rmind@.
2008-02-09 17:01:51 +00:00
christos
a0e4739ced
PR/37932: Yakovetsky Vladimir: build distribution with USE_FORT fails
...
Avoid read redefinition
2008-02-02 17:09:29 +00:00
ad
d8251138f4
pthread_rwlock_wrheld_np: return true only if locked by the calling thread.
2008-01-31 11:50:40 +00:00
mlelstv
58dedb340c
use the correct symbols
2008-01-31 10:07:09 +00:00
rmind
b5e9addd22
sched_setparam: fix the case when incorrect (according to the class)
...
in-kernel priority is used. Reported by <drochner>.
Minor fixes for scheduling calls to conform the POSIX:
- If pid is equal to zero, use the calling process;
- In case of permission problem, return EPERM instead of EACESS;
- sched_setscheduler() should return previously used policy;
- pthread_* calls should return the error code or zero;
Should fix the namespace problems (and builds of some packages):
- Move cpuset_t defintion from pset.h to sched.h;
- Remove the #include of pset.h in pthread.h;
2008-01-26 17:55:29 +00:00
rafal
2e86943de9
Make this compile after Andrew's fix (remove now-unused variables)
2008-01-25 02:12:10 +00:00
ad
bba572530b
pthread_mutex_lock_slow: remove "deliberate deadlock" code that's not
...
needed with 1:1. PR lib/37524.
2008-01-25 01:09:18 +00:00
christos
19884cbfe6
s/set/test/
2008-01-19 16:05:34 +00:00
christos
f2df27b721
only include <sys/pset.h> if _NETBSD_SOURCE
2008-01-19 16:03:48 +00:00
rmind
5c71a4d49f
Implementation of processor-sets, affinity and POSIX real-time extensions.
...
Add schedctl(8) - a program to control scheduling of processes and threads.
Notes:
- This is supported only by SCHED_M2;
- Migration of LWP mechanism will be revisited;
Proposed on: <tech-kern>. Reviewed by: <ad>.
2008-01-15 03:37:10 +00:00
christos
c6409540ef
add missing static decls.
2008-01-08 20:56:08 +00:00
christos
6c924f05f9
cast -1 to unsigned int.
2008-01-08 20:55:58 +00:00
christos
72f5cf0283
no semis after weak alias.
2008-01-08 20:55:25 +00:00
yamt
48a1e4cf46
pthread_curcpu_np: map LWPCTL_CPU_NONE to 0 so that this works in the case
...
of _lwp_ctl failure.
2008-01-07 11:51:43 +00:00
ad
b43749fde1
machine/lock.h, not sys/lock.h
2008-01-05 01:37:35 +00:00
ad
622bbc505a
- Use pthread__cancelled() in more places.
...
- pthread_join(): assert that pthread_cond_wait() returns zero.
2007-12-24 16:04:20 +00:00
ad
989565f81d
- Fix pthread_rwlock_trywrlock() which was broken.
...
- Add new functions: pthread_mutex_held_np, mutex_owner_np, rwlock_held_np,
rwlock_wrheld_np, rwlock_rdheld_np. These match the kernel's locking
primitives and can be used when porting kernel code to userspace.
- Always create LWPs detached. Do join/exit sync mostly in userland. When
looped on a dual core box this seems ~30% quicker than using lwp_wait().
Reduce number of lock acquire/release ops during thread exit.
2007-12-24 14:46:28 +00:00
ad
8f05f9cc26
Update.
2007-12-24 14:30:09 +00:00
yamt
45cbede9e5
document following functions.
...
pthread_attr_getname_np
pthread_attr_setname_np
pthread_getname_np
pthread_setname_np
2007-12-14 21:51:21 +00:00
ad
5a5d5865cd
Remove test of pthread__osrev that is no longer needed.
2007-12-11 03:21:30 +00:00
ad
37132d5d2f
Back out previous now that libc/libpthread are initialized first.
2007-12-07 20:36:52 +00:00
ad
a9718d7115
pthread__mutex_lock_slow: avoid entering the waiters list if a race to
...
acquire the mutex is lost. Removing the current thread from the waiters
list requires at least one syscall.
2007-12-07 01:38:38 +00:00
yamt
f078e05288
pthread__mutex_wakeup: ignore ESRCH from _lwp_unpark.
...
once we clear pt_sleeponq, the target thread can proceed further
and even do pthread_exit.
2007-12-04 16:56:11 +00:00
yamt
fc51c23a2d
remove unnecessary assignments.
2007-12-04 16:08:28 +00:00
wiz
a6e62b1ef7
Use more markup. New sentence, new line.
2007-12-01 19:03:26 +00:00
ad
64ebe1397e
Hack around ld.so initializing pthread users before libpthread/libc.
2007-12-01 01:19:31 +00:00
ad
b565a56cfb
- On 64-bit platforms 1/2 the default tsd values were garbage. Fix it.
...
- The lwpctl block is now needed on uniprocessors, for pthread_curcpu_np().
2007-12-01 01:07:34 +00:00
ad
ae87f94d1d
Bump libc/libpthread minor for thr_curcpu()/pthread_curcpu_np().
2007-11-27 21:06:41 +00:00
ad
4084ca7f3f
Add thr_curcpu(), pthread_curcpu_np().
2007-11-27 20:58:26 +00:00
ad
d5e9b90716
Fix a warning with _LP64.
2007-11-27 20:55:03 +00:00
ad
a4c99db9fe
Sync with reality, and note that programs must link against the dynamic
...
libpthread in order to remain compatible with future releases of NetBSD.
2007-11-19 15:53:20 +00:00
ad
8077340e63
Remove the debuglog stuff. ktrace is more useful now.
2007-11-19 15:14:11 +00:00
ad
a448c4f214
int -> ssize_t in a couple of places.
2007-11-19 15:12:18 +00:00
drochner
095b25e7dd
Add pthread_equal() to libc stubs; this makes a lot of sense for
...
threadsafe libraries implementing own locking functions.
Ride on yesterday's minor version bumps.
2007-11-14 19:28:23 +00:00
ad
4be57c5368
Don't try to block if there are already waiters; it doesn't make sense.
2007-11-14 17:20:57 +00:00
ad
b919eb8116
Crank libpthread to 0.8. It now uses _lwp_ctl(), and it's handy to keep
...
0.7 hanging around for old kernels.
2007-11-13 17:22:51 +00:00
ad
66ac2ffaf2
Mutexes:
...
- Play scrooge again and chop more cycles off acquire/release.
- Spin while the lock holder is running on another CPU (adaptive mutexes).
- Do non-atomic release.
Threadreg:
- Add the necessary hooks to use a thread register.
- Add the code for i386, using %gs.
- Leave i386 code disabled until xen and COMPAT_NETBSD32 have the changes.
2007-11-13 17:20:08 +00:00