| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Reviewed by: deischen
|
|
|
|
|
|
| |
accordingly.
Reviewed by: deischen
|
|
|
|
| |
Reviewed by: deischen
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a shared library or any other dyanmic allocated data block, once
pthread_once_t is initialized, a mutex is allocated, if we unload the
shared library or free those data block, then there is no way to deallocate
the mutex, result is memory leak.
To fix this problem, we don't use mutex field in pthread_once_t, instead,
we use its state field and an internal mutex and conditional variable in
libkse to do any synchronization, we introduce a third state IN_PROGRESS to
wait if another thread is already in invoking init_routine().
Also while I am here, make pthread_once() conformed to pthread cancellation
point specification.
Reviewed by: deischen
|
|
|
|
| |
Reviewed by: deischen
|
| |
|
|
|
|
| |
pthread_rwlock_timedrwlock.
|
|
|
|
|
| |
jumping to .cerror. This means .cerror has to be present in the
same module with its consumers, or bad things will happen.
|
|
|
|
|
|
| |
pthread_mutex_timedlock().
Reviewed by: deischen
|
| |
|
|
|
|
| |
without this change, my atexit test dumps core.
|
|
|
|
|
|
|
|
|
|
|
|
| |
instead of long types for low-level locks.
Add prototypes for some internal libc functions that are
wrapped by the library as cancellation points.
Add memory barriers to alpha atomic swap functions (submitted
by davidxu).
Requested by: bde
|
|
|
|
| |
Tested on: SMP
|
|
|
|
|
|
| |
only needed symbols from libc_pic is not working on sparc64.
Requested by: jake
|
|
|
|
| |
Reviewed by: davidxu
|
|
|
|
|
|
| |
in real world.
Reviewed by: deischen
|
|
|
|
|
|
|
|
|
| |
critical region, we wrap some syscalls for thread cancellation point, and
when syscalls returns, we call _thr_leave_cancellation_point, at the time
if a signal comes in, it would be buffered, and when the thread leaves
_thr_leave_cancellation_point, buffered signals will be processed, to avoid
messing up normal syscall errno, we should save and restore errno around
signal handling code.
|
|
|
|
|
|
|
| |
destroy thread-specific data. Display a warning when thread
specific data remains after PTHREAD_DESTRUCTOR_ITERATIONS.
Reviewed by: davidxu
|
|
|
|
| |
Reviewed by: deischen
|
| |
|
|
|
|
|
|
| |
pthread_exit in main() without creating any thread.
Tessted by: deischen
|
|
|
|
|
|
|
|
|
| |
yet, so we can protect some locking code from being interrupted by signal
handling. When KSE mode is turned on, reset the thread flag to scope process
except we are running in 1:1 mode which we needn't turn it off.
Also remove some unused member variables in structure kse.
Tested by: deischen
|
| |
|
|
|
|
|
|
| |
Don't free them, so some code can still reference them.
Reviewed by: deischen
|
|
|
|
| |
a key is less than 0.
|
|
|
|
|
|
| |
have execute permissions. Run "perl verify" instead. Replace all
occurences of the hardcoding of ./verify with $(VERIFY) to allow
it to be overridden as well.
|
|
|
|
| |
time.
|
| |
|
|
|
|
| |
Reviewed by: deischen, julian
|
|
|
|
|
|
| |
signal can causes process to exit.
Reviewed by: deischen
|
|
|
|
| |
uninitialize rtld lock after thread mode shutdown.
|
|
|
|
|
|
|
|
| |
otherwise masks all signals until fork() returns, in child process,
we reset library state before restoring signal masks until we reach
a safe to point.
Reviewed by: deischen
|
|
|
|
|
|
| |
on writer lock. This is first cut at rwlock for rtld.
Submitted by: desichen
|
|
|
|
| |
Reviewed by: deischen
|
|
|
|
|
|
| |
there is still some missing kernel support.
Reviewed by: marcel
|
|
|
|
|
|
|
| |
o Fix a bug in kse_free_unlocked(), kcb_dtor shouldn't be called because
the KSE is cached and will be resued in _kse_alloc().
Reviewed by: deischen
|
|
|
|
|
|
|
| |
bypass it. Doing otherwise did not allow compiler to detect and disable
conflicting options generated from specs.
Reported by: jake
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
happens, the context of the interrupted thread is exported to
userland. Unlike most contexts, it will be an async context and
we cannot easily use our existing functions to set such a
context.
To avoid a lot of complexity that may possibly interfere with
the common case, we simply let the kernel deal with it. However,
we don't use the EPC based syscall path to invoke setcontext(2).
No, we use the break-based syscall path. That way the trapframe
will be compatible with the context we're trying to restore and
we save the kernel a lot of trouble. The kind of trouble we did
not want to go though ourselves...
However, we also need to set the threads mailbox and there's no
syscall to help us out. To avoid creating a new syscall, we use
the context itself to pass the information to the kernel so that
the kernel can update the mailbox. This involves setting a flag
(_MC_FLAGS_KSE_SET_MBOX) and setting ifa (the address) and isr
(the value).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
TCB. We know that the thread pointer points to &tcb->tcb_tp, so all
we have to do is subtract offsetof(struct tcb, tcb_tp) from the
thread pointer to get to the TCB. Any reasonably smart compiler will
translate accesses to fields in the TCB as negative offsets from TP.
In _tcb_set() make sure the fake TCB gets a pointer to the current
KCB, just like any other TCB. This fixes a NULL-pointer dereference
in _thr_ref_add() when it tried to get the current KSE.
|
|
|
|
|
|
|
| |
thread. It should only be called by the current kse and
never by a KSE on behalf of another.
Submitted by: davidxu
|
|
|
|
|
|
| |
makecontext(). We only supply 3, not 4. This is mostly harmless,
except that on ia64 the garbage can include NaT bits, resulting
in NaT consumption faults.
|
|
|
|
|
|
|
| |
that the TLS is 16-byte aligned, as well as guarantee that the thread
pointer is 16-byte aligned as it points to struct ia64_tp. Likewise,
struct tcb and struct ksd are also guaranteed to be 16-byte aligned
(if they weren't already).
|
| |
|
|
|
|
|
|
|
|
|
| |
archs that can (or are required to) have per-thread registers.
Tested on i386, amd64; marcel is testing on ia64 and will
have some follow-up commits.
Reviewed by: davidxu
|
|
|
|
|
|
|
|
|
| |
context functions. We don't need to enter the kernel anymore. The
contexts are compatible (ie a context created by getcontext() can
be restored by _ia64_restore_context()).
While here, make the use of THR_ALIGNBYTES and THR_ALIGN a no-op.
They are going to be removed anyway.
|
|
|
|
|
|
|
|
|
|
| |
We write 1 for r8 in the context so that _ia64_restore_context()
will return with a non-zero value. _ia64_save_context() always
return 0.
o In _ia64_restore_context(), don't restore the thread pointer. It
is not normally part of the context. Also, restore the return
registers. We get called for contexts created by getcontext(),
which means we have to restore all the syscall return values.
|
| |
|
|
|
|
| |
Reminded by: marcel
|