Commit Graph

281 Commits

Author SHA1 Message Date
christos b7559f8576 PR/23791: Patrick Latify: Fix memory leak on thread creation failure. 2003-12-18 15:39:56 +00:00
jmc d9948df6dd Clean up tmp files on exit. Fixes PR#23723 2003-12-15 20:07:39 +00:00
christos 1edf98ec41 Add pthread_{g,s}etschedparam, that do nothing. 2003-12-07 20:29:07 +00:00
cl 2c9b7b1eb7 Set default stack size to the current limit on the stack size as set
with the shell's command to change limits.  Make the PTHREAD_STACKSIZE
environment variable override the default stack size.  The old fixed
stack size behaviour can be enable with PT_FIXEDSTACKSIZE_LG when building
libpthread.
2003-11-27 16:30:54 +00:00
he ea56bcee84 Hide the register number constants behind an _R_ prefix, and also
rename FPBASE to _FPBASE, so that we avoid polluting the user's
name space when e.g. <sys/ptrace.h> is included.  Previously, the
PC symbol in mips/regnum.h would conflict with the declaration of
the external variable by the same name in termcap.h, as discovered
by the ``okheaders'' regression test.
2003-11-26 08:36:49 +00:00
cl 11127744bf Save the old mask in the old context, not in the new one. 2003-11-25 23:55:27 +00:00
cl d109665f1d Honor SA_NODEFER in pthread__deliver_signal(). This should help code which
makes a longjmp out of a signal handler.

Also add missing si_code argument to debugging printf in pthread__kill().
2003-11-25 22:45:33 +00:00
christos 0446e60323 Update list of items. 2003-11-25 22:44:16 +00:00
christos adfca9e3e4 This is not needed anymore. 2003-11-25 22:41:12 +00:00
christos 5077d05f7b GC sigcontext<->mcontext code and __HAVE_SIGINFO. All supported archs have
siginfo implemented.
2003-11-25 22:36:32 +00:00
christos 69658517e0 - don't store sigmask on the stack, we could store it in the right place
[in the context]
- this has the side effect of fixing the problem of the signal mask not
  being preserved properly upon signal return, found and fixed by cl.
- add si_code to the tramp debugging output (requested by cl).
2003-11-25 22:26:44 +00:00
christos 6477735848 m68k does not sigcontext<->mcontext anymore. 2003-11-25 21:27:30 +00:00
cl 774b4b225b Update mutex/rwlock/sem code to match recent change in cond code. 2003-11-24 23:54:13 +00:00
cl 4f8ea51319 add CONSTCOND in constant condition. 2003-11-24 23:23:17 +00:00
nathanw 250e7bbf8e Fix a race between timed wait callbacks and manual signal/broadcasting
accidentally introduced in rev. 1.5.

Noted by Christian Limpach.
2003-11-24 22:54:31 +00:00
nathanw cdf7f99ee6 Manually inline pthread__testcancel in these routines; two function
calls' worth of overhead per cancellable syscall is overkill.
2003-11-21 23:03:13 +00:00
nathanw 4e755ddba8 Prevent ptc_mutex from remaining set if a CV sleep is woken by
cancellation:

 * Arrange to not set ptc_mutex until after the pre-sleep cancellation
   test.

 * In the post-sleep cancellation test, check if there are no more
   sleepers and clear ptc_mutex if so.

While here, sprinkle some __predict_false() around the cancellation
tests.
2003-11-21 22:08:00 +00:00
uwe 6d08061385 Do not move incoming paramters to callee-save registers when not
necessary.  Saves about a dozen of instructions.
2003-11-20 17:55:11 +00:00
uwe 4b13bb93a0 Follow-up to previous. In pthread__signal_tramp() maskp is below
siginfo on the stack, so get it from there.  ss_sp no longer points to
the the mask.  Pointed out by cl@.
2003-11-20 17:45:00 +00:00
uwe b3c165e505 Add _INITCONTEXT_U_MD, we need to clean _REG_SR. 2003-11-20 17:38:08 +00:00
uwe f5cd7f26ed Undo previous. In pthread__deliver_signal set uc->uc_stack.ss_sp = uc;
(as it used to be before 1.1.2.12) so that makecontext doesn't stomp
on the data we allocated on the stack.  Correct the debugging printf
to print olduc instead of target->pt_uc (we have pt_trapuc now, and
olduc can be pt_trapuc).
2003-11-20 17:16:41 +00:00
yamt d7b65981fb pthread__deliver_signal: swap oldmask and siginfo so that signal
handler's stack doesn't stomp siginfo.
this also fixes !__HAVE_SIGINFO, in that case
pthread__signal_tramp assumes uc->uc_stack.ss_sp points the old
signal mask.

pointed by uwe@.
2003-11-20 15:46:42 +00:00
uwe 1e78682585 In pthread__locked_switch set self->pt_uc only when the context is inited.
In STACK_SWITCH subtract STACKSPACE, not add it (it's zero for now anyway).
2003-11-20 03:31:02 +00:00
uwe 024d461f8f First cut at pthreads MD code for sh3. Based on m68k version.
Regression tests still failing: sem, sigalarm.
2003-11-18 03:11:41 +00:00
uwe f9cb911365 Add necessary symbols. 2003-11-18 03:07:29 +00:00
thorpej 88ed237274 Bump libc to 12.107 and libpthread to 0.3 for fsync_range(2). 2003-11-18 01:00:19 +00:00
thorpej 137c808bb8 Userland portion of fsync_range(2), written by Bill Studenmund, and
contributed by Wasabi Systems, Inc.
2003-11-18 00:56:56 +00:00
cl 196dbdcd2b - delay processing unblocked threads until after locks are resolved:
without the blocked/unblocked upcall ordering, an interrupted blocked
  upcall might put the blocked thread on the intqueue because it needs
  to be continued.  With the delayed processing, we avoid putting such a
  thread twice on the runqueue.
- fix putting a thread on the intqueue when it needs to be continued
  after it blocked.

Also check return value when returning a single stack.
2003-11-17 22:59:00 +00:00
uwe 764c596c3f Cause SIGTRAP if NOTREACHED code is reached. 2003-11-17 22:38:11 +00:00
cl 803f13c062 check deferred signals for all unblocked threads 2003-11-12 22:21:21 +00:00
wiz c3c78af0ec Various fixes. 2003-11-12 11:58:34 +00:00
christos c8608b903b Document pthread_attr_setcreatesuspend_np, pthread_suspend_np, pthread_resume_np 2003-11-12 02:44:22 +00:00
martin 3e8ef3d56a Fix ucontext conversion macros. From Christian Limpach. 2003-11-11 16:21:05 +00:00
martin d708163f7f All the ucontext <-> {fp}reg macros were slightly simplistic and untested
before (old gdb support on sparc did not use this).
Pointed out by Christian Limpach.
2003-11-10 07:52:52 +00:00
christos 38b1c6f405 Add:
int    pthread_attr_setcreatesuspend_np(pthread_attr_t *);
int    pthread_suspend_np(pthread_t);
int    pthread_resume_np(pthread_t);

needed for java. Approved and fixed by cl.
2003-11-09 18:56:48 +00:00
fvdl c4e432f3bd Make register usage more consistent, also in comparison with the i386
version, for easier maintenance.
2003-11-08 21:46:42 +00:00
fvdl 127827f46e Restore %rax correctly during a full context restore (oops). 2003-11-08 21:45:59 +00:00
wiz 85cc64da0f Typo; from Jared Yanovich via jmc@openbsd. 2003-11-02 11:18:10 +00:00
yamt 71b290e975 use explicit "l" suffixes. (eg. lea -> leal) 2003-10-30 13:56:37 +00:00
wiz bc81ecac30 sigwait(2), not (3). 2003-10-30 12:57:11 +00:00
jdolecek e2e1314ccd bump date too 2003-10-30 11:53:33 +00:00
jdolecek f65cf67b62 xref sigwait(3) 2003-10-30 11:51:42 +00:00
cl 812a254c5d remove incorrect assert:
regular threads can block in the kernel while holding (libpthread) locks
and have to be continued

XXX if the blocked upcall is preempted, the blocked threads syscall
XXX return value can get lost
2003-10-29 18:53:34 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00
yamt 2016949b00 update a comment. 2003-10-24 17:35:22 +00:00
fvdl c2405107f1 Correct and simplify computing the return point; just use PC-relative
addressing.
2003-10-20 14:50:18 +00:00
fvdl b30e737545 Make sure the stack stays aligned. 2003-10-19 21:45:03 +00:00
yamt 5cd18e71cc in pthread__deliver_signal(),
copy siginfo_t into the stack of the target thread
rather than relying on the luck that on-stack siginfo_t stay valid.
2003-10-16 13:38:28 +00:00
chs f58c80fc8f fix typo in previous. 2003-10-12 00:25:25 +00:00
wiz 37ac1db454 available, not avaliable. From miod@openbsd. 2003-09-29 09:50:21 +00:00