Commit Graph

268 Commits

Author SHA1 Message Date
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
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
ru
5f8b6d3c5a Convert NO_PROFILE and NO_LIB32 to new style. 2006-03-18 21:37:05 +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