Commit Graph

232 Commits

Author SHA1 Message Date
wiz 37ac1db454 available, not avaliable. From miod@openbsd. 2003-09-29 09:50:21 +00:00
nathanw 9839173881 Don't include <machine/lock.h> anymore; instead, we now get
__cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED from <sys/types.h>.
Should prevent the massive namespace pollution by way of dragging in
many MD headers that has been observed to break stuff.
2003-09-26 22:48:23 +00:00
cl bfa716044e SA_SIGINFO support for m68k (libpthread) 2003-09-22 14:45:48 +00:00
cl c6de69ee49 fix pt_trapuc handling errors:
- movl to address register doesn't set flags (add explicit test)
- clr only clears a word (use clrl)
2003-09-17 20:08:07 +00:00
cl 5c40d56471 fix SA/pthread pagefault failure:
- prevent BLOCKED upcalls on double page faults and during upcalls
- make libpthread handle blocked threads which hold locks
- prevent UNBLOCKED upcalls from overtaking their BLOCKED upcall
this adds a new syscall sa_unblockyield
see also http://mail-index.netbsd.org/tech-kern/2003/09/15/0020.html
2003-09-16 13:51:31 +00:00
christos 86d645082f fix syntax; thanks aymeric 2003-09-13 17:19:55 +00:00
christos d1bb4290e8 explicitly use a sigset_t * variable to recover the signal mask pointer. 2003-09-13 15:26:38 +00:00
drochner 45a9abb6af make it compile with PTHREAD_SIG_DEBUG again 2003-09-12 15:31:00 +00:00
kleink 8742dcef75 Fix pasto in previous. 2003-09-12 10:10:39 +00:00
christos 138df80b74 convert to use siginfo/ucontext style of signal delivery instead of
sigcontext. Approved by nathanw.
2003-09-12 00:37:17 +00:00
christos 338cc5f663 sprinkle ARGSUSED for good cheer. 2003-09-11 21:51:57 +00:00
cl 89d0cfd21f Remove possible race condition in upcall recycling. 2003-09-07 14:47:44 +00:00
uwe b5623b232f Use delay slot in STACK_SWITCH (catching up with sparc64 changes). 2003-09-07 02:08:31 +00:00
uwe 7d522ba08b Use correct context to switch to.
From sparc64 fix by Andrey Petrov <petrov@netbsd>.
2003-09-07 01:54:47 +00:00
petrov 0d472e116b typo in previous commit, annul isn't good there,
noticed by Eduardo Horvath.
2003-08-26 17:50:06 +00:00
petrov 2cae323122 Use branch-slot in STACK_SWITCH, suggested by Martin Husemann. 2003-08-25 23:00:23 +00:00
petrov c139cd4893 Use correct context to switch to. 2003-08-25 22:48:24 +00:00
ragge 644236bf71 Add PT_TRAPUC and pthread__switch_return_point.
Not tested (as most of the pthread stuff on vax) but at least
allow the system to compile.
2003-08-25 20:32:13 +00:00
nathanw e1fb9dd8e8 In pthread__deliver_signal(), correctly use pt_trapuc or pt_uc as the
context-to-restore instead of always using pt_uc.

Fixes a problem with signal handlers for synchronous signals noted by
Matthias Drochner on current-users.
2003-08-22 17:35:52 +00:00
martin 88055fbde5 Include <stdlib.h> for exit() prototype. 2003-08-20 09:50:16 +00:00
nathanw bd9a18b79f Split out pthread_{set,get}specific() into a separate file and arrange
for that file to not be built with profiling. This makes it reasonable to
use pthread_{set,get}specific() to implement thread-safe profiline call counts.
2003-08-13 18:52:01 +00:00
scw 46fc66f7d8 Adapt to Nathan's recent pt_trapuc/pt_sleepuc change. 2003-08-12 14:01:08 +00:00
agc eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
lukem a93ea220fc Rework how dependency generation is performed:
* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
  This is a change of behaviour.  If a Makefile wants the clean semantics
  it must specifically append to CLEANFILES.
  Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
  that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d  depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
2003-08-01 17:03:41 +00:00
kleink 7d3a44f705 Remove PT_SLEEPUC, which somehow wasn't. 2003-07-29 15:18:49 +00:00
salo 99410184e7 netbsd.org->NetBSD.org 2003-07-26 19:24:24 +00:00
mrg 9759912dd6 need <string.h> 2003-07-26 18:33:06 +00:00
skrll 795970599f Typo in comment. 2003-07-24 08:03:44 +00:00
wiz 576530e520 Add pthread(3), based on one by Hubert Feyrer, improved by yours truly,
reviewed by Nathan J. Williams.
2003-07-24 07:50:24 +00:00
nathanw 0878df5d25 Lock accesses to pt_flags and pt_cancel.
When disabling cancellation, clear the pt_cancel flag if it was set
and note the cancellation request with PT_FLAG_CS_PENDING. This avoids
a problem where a cancellation request entered but not acted upon before
pthread_setcanclstate(PTHREAD_CANCEL_DISABLE) is called would still be
aceted upon before cancellation was re-enabled.
2003-07-21 22:24:09 +00:00
nathanw 329747fb90 Add a lock on the pt_flags field. 2003-07-21 22:21:07 +00:00
nathanw 0c96790183 Use _sys_write() instead of write() in the assertion and error
functions, to avoid invoking the cancellation machinery in the middle
of trying to print an assertion or error message.
2003-07-21 22:17:14 +00:00
nathanw 68a63a4079 Move initialization of variable 'nthreads' so that pthread_exit() from
the main thread, with no other threads created, exits cleanly instead
of triggering an assertion in pthread_next().
2003-07-21 22:14:57 +00:00
nathanw ec2c169839 pthread.c was getting a bit unwieldly. Move pthread_attr stuff out
into a new file, and put the shared private structure definition in
pthread_int.h.
2003-07-18 22:33:45 +00:00
nathanw 0172694e7d Implement a bunch of pthread_attr_() functions, which genuinely set and examine
pthread_attr_t objects, although most of the properties being set don't really
affect threads yet:

pthread_attr_{get,set}guardsize()
pthread_attr_{get,set}inheritsched()
pthread_attr_{get,set}scope()
pthread_attr_{get,set}stack()
pthread_attr_setstack{size,addr}()

Remove some useless assertions and error checks in the existing pthread_attr()
routines.

Implement pthread_attr_get_np(), to examine the attributes of an existing
thread. Idea and interface from FreeBSD.

Change PTHREAD_ERRORMODE environment variable to PTHREAD_DIAGASSERT, and
make it behave like libc's LIBC_DIAGASSERT. The way to disable error-checking
and aborting is now "PTHREAD_DIAGASSERT=AEL", rather than
"PTHREAD_ERRORMODE=ignore".
2003-07-18 22:12:30 +00:00
nathanw 067fa34e42 Add prototypes and necessary symbols for a bunch of pthread_attr_*() functions,
including (interface borrowed from FreeBSD) pthread_attr_get_np().

Remove a few limit-indicating symbols that don't actually need to be defined
(and if they did need to be defined, it would be in limits.h, not here).
2003-07-18 22:01:47 +00:00
nathanw 9e5c87057d Add strong alias for setcancelstate. 2003-07-18 21:57:26 +00:00
lukem 98e8a6d142 #include <pthread_types.h> instead of "pthread_types.h" 2003-07-18 15:58:43 +00:00
nathanw 1a9edd35f7 Simplify pthread__stackalloc() by using the newish aligned-mmap()
feature.
2003-07-17 21:07:39 +00:00
nathanw d686fc0deb Define PTHREAD_* structure initializers from _PTHREAD_* macros from
pthread_types.h.
2003-07-17 20:59:35 +00:00
nathanw d37a996a49 Adapt to structure name changes. 2003-07-17 20:55:25 +00:00
nathanw deb18e9d04 Adapt to internal structure name changes.
Add a couple of useful flags and symbols.
2003-07-17 20:52:38 +00:00
nathanw c541f9e56a Prepare for inclusion in sys/types.h by ensuring that all the symbols
defined end with _t or start with _[A-Z_].
2003-07-17 20:51:36 +00:00
nathanw 608b92c095 Don't use PTHREAD_DESTRUCTOR_ITERATIONS; the constant is going away. 2003-07-17 20:40:43 +00:00
fvdl 2949ab0051 Take the normal return path in sigtimedwait when the current thread was
canceled as well. From Stephan Uphoff.
2003-07-17 18:15:21 +00:00
nathanw e171479839 pthread_kill() prototype moved to <signal.h>. 2003-07-16 21:26:33 +00:00
matt 0f8d87a96d Update to new world order. **not tested** But will allow builds to
finish.
2003-07-09 00:55:45 +00:00
uwe ea81adf86a Not that the branch in SETC doens't have a delay slot, remove the
.empty comment as it's no longer pertinent.
2003-07-05 23:01:25 +00:00
marcus 4e24351384 PIC patch from Valeriy E. Ushakov applied.
Also, removed bogus delay slot flag from branch instruction.
2003-07-05 22:50:09 +00:00
marcus cccf9dfce5 The field "pt_sleepuc" doesn't exist in struct pthread_st. 2003-07-05 21:27:23 +00:00