| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
to _thread_kern_sig_undefer().
|
|
|
|
|
|
|
| |
prematurely release recursive mutexes.
Test case provided by: Bradley T. Hughes <bhughes@trolltech.com>
Reviewed by: deischen
|
|
|
|
| |
Noted as missing by: nicolas.leonard@animaths.com
|
|
|
|
| |
POSIX/SUSv2.
|
|
|
|
|
|
|
| |
This fixes a segfault in some C++ programs which use exceptions before
main() has been called (i.e. from global constructors).
Reviewed by: deischen
|
| |
|
|
|
|
| |
(jasone@canonware.com --> jasone@freebsd.org).
|
|
|
|
|
|
|
|
|
| |
pthread_cond_signal(), pthread_cond_broadcast(), and pthread_cond_timedwait().
Do not dump core in pthread_cond_timedwait() (due to a NULL pointer
dereference) if attempting to wait on an uninitialized condition variable.
PR: bin/18099
|
|
|
|
| |
Prompted by: sheldonh
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
not have a user-supplied signal handler, when a signal is delivered, one
thread will receive the signal, and then the code reverts to having no
signal handler for the signal. This can leave the other sigwait()ing
threads stranded permanently if the signal is later ignored, or can result
in process termination when the process should have delivered the signal to
one of the threads in sigwait().
To fix this problem, maintain a count of sigwait()ers for each signal that
has no default signal handler. Use the count to correctly install/uninstall
dummy signal handlers.
Reviewed by: deischen
|
|
|
|
|
|
|
|
|
|
| |
not allowed to return EINTR, but use of pthread_suspend_np() could cause
EINTR to be returned. To fix this, restructure pthread_suspend_np() so that
it does not interrupt a thread that is waiting on a mutex or condition, and
keep enough state around that pthread_resume_np() can fix things up
afterwards.
Reviewed by: deischen
|
| |
|
|
|
|
|
|
| |
It was not discussed and should probably not happen.
Requested by: msmith and others
|
|
|
|
|
|
|
|
| |
the type argument to *_HEAD and *_ENTRY is a struct.
Suggested by: phk
Reviewed by: phk
Approved by: mdodd
|
|
|
|
|
|
| |
was not deallocating space for the previous name, if any.
PR: misc/18504
|
|
|
|
|
|
| |
_thread_gc() was not deallocating it.
PR: misc/18504
|
| |
|
|
|
|
|
| |
including <signal.h>, but that must be a bug in POSIX.1, because it
also specifies that the relevant prototype is [only] in <pthread.h>.
|
| |
|
|
|
|
|
| |
the man page and POSIX.1. Fixed nearby misformatting. Fixed a missing
prototype.
|
|
|
|
|
| |
PR: 18465
Reported by: Kazu TAKAMUNE <takamune@avrl.mei.co.jp>
|
|
|
|
|
|
|
|
|
|
|
| |
. use real function names as `.Nm' macro argument in NAME section. It allows
them to appear in apropos(1) or whatis(1) output.
. replace empty lines with `.Pp' macro.
. replace hardcoded standard names with their `.St' macro equivalents.
. sort cross references in SEE ALSO section
|
| |
|
|
|
|
|
|
| |
error return values. Implement pthread_mutexattr_gettype().
PR: docs/16537, docs/17538
|
|
|
|
| |
PR: bin/17366
|
| |
|
|
|
|
|
| |
a new test for POSIX semaphores was added, and examples of harness usage are
included.
|
| |
|
|
|
|
| |
rather than getting lucky due to header dependencies.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
thread waiting on an event (I/O, condvar, etc) will, when resumed using
pthread_resume_np, return with EINTR. For example, suspending and resuming
a thread blocked on read() will not requeue the thread for the read, but
will return -1 with errno = EINTR. If the suspended thread is in a critical
region, the thread is suspended as soon as it leaves the critical region.
Fix a bogon in pthread_kill() where a signal was being delivered twice
to threads waiting in sigwait().
Reported by (suspend/resume bug): jdp
Reviewed by: jasone
|
|
|
|
|
| |
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
|
|
|
|
|
|
|
| |
Submitted by: reg
Reviewed by: ru
Approved by: jasone (rev 1.9)
Pointy hat to: unfurl
|
|
|
|
| |
Submitted by: Thimble Smith <tim@mysql.com>
|
|
|
|
|
|
| |
PR: 16537
Submitted by: AnarCat <beaupran@iro.umontreal.ca>
Approved by: jasone
|
|
|
|
|
|
|
|
|
| |
returning the error directly.
For sem_post(), make sure that the correct thread is woken up. This has
unfortunate performance implications, but is necessary for POSIX compliance.
Approved by: jkh
|
|
|
|
| |
Approved by: jkh
|
|
|
|
| |
weak symbols of the same name are not used.
|
|
|
|
| |
Reported by: green
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
just use _foo() <-- foo(). In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate. In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().
Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().
Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().
Make thread cancellation fully POSIX-compliant.
Suggested by: deischen
|
|
|
|
| |
PR: misc/16245
|
| |
|
|
|
|
|
|
|
| |
are not supported by this implementation, and the error return values
from sem_init(), sem_open(), sem_close(), and sem_unlink() reflect this.
Approved by: jkh
|
|
|
|
| |
Submitted by: deischen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
signal handler. Explicitly check for jumps to anywhere other than the
current stack, since such jumps are undefined according to POSIX.
While we're at it, convert thread cancellation to use continuations, since
it's cleaner than the original cancellation code.
Avoid delivering a signal to a thread twice. This was a pre-existing bug,
but was likely unexposed until these other changes were made.
Defer signals generated by pthread_kill() so that they can be delivered on
the appropriate stack. deischen claims that this is unnecessary, which is
likely true, but without this change, pthread_kill() can cause undefined
priority queue states and/or PANICs in [sig|_]longjmp(), so I'm leaving
this in for now. To compile this code out and exercise the bug, define
the _NO_UNDISPATCH cpp macro. Defining _PTHREADS_INVARIANTS as well will
cause earlier crashes.
PR: kern/14685
Collaboration with: deischen
|
|
|
|
|
|
|
| |
the case that a CPU hungry main thread is prevented from being preempted
due to a negative calculation of its time slice.
Reported by: Alexander Litvin <archer@lucky.net>
|
|
|
|
|
| |
the _libc_*() entry points and add *() weak aliases. This will all
change for the better when libc_r becomes libpthread.
|
|
|
|
|
|
|
| |
This doesn't need to be applied to stable, because somehow -stable seems
to have gotten it right.
Reviewed by: jasone
|
|
|
|
|
|
|
|
|
|
| |
the initial thread). Instead, just leave an unmapped gap between thread
stacks and make sure that the thread stacks won't grow into these gaps,
simply by limiting the size of the stacks with the 'len' argument to
mmap(). This (if I understand correctly) reduces VM overhead
considerably.
Reviewed by: deischen
|