| Commit message (Expand) | Author | Age | Files | Lines |
| * | use restrict everywhere it's required by c99 and/or posix 2008•••to deal with the fact that the public headers may be used with pre-c99
compilers, __restrict is used in place of restrict, and defined
appropriately for any supported compiler. we also avoid the form
[restrict] since older versions of gcc rejected it due to a bug in the
original c99 standard, and instead use the form *restrict.
| Rich Felker | 2012-09-06 | 1 | -1/+1 |
| * | fix (hopefully) all hard-coded 8's for kernel sigset_t size•••some minor changes to how hard-coded sets for thread-related purposes
are handled were also needed, since the old object sizes were not
necessarily sufficient. things have gotten a bit ugly in this area,
and i think a cleanup is in order at some point, but for now the goal
is just to get the code working on all supported archs including mips,
which was badly broken by linux rejecting syscalls with the wrong
sigset_t size.
| Rich Felker | 2012-08-09 | 1 | -1/+2 |
| * | more efficient signal blocking for timer threads•••due to the barrier, it's safe just to block signals in the new thread,
rather than blocking and unblocking in the parent thread.
| Rich Felker | 2011-08-12 | 1 | -4/+4 |
| * | normal exit from timer thread should run dtors, restore cancel state | Rich Felker | 2011-08-11 | 1 | -1/+1 |
| * | block signals in timer threads•••if a timer thread leaves signals unblocked, any future attempt by the
main thread to prevent the process from being terminated by blocking
signals will fail, since the signal can still be delivered to the
timer thread.
| Rich Felker | 2011-08-11 | 1 | -0/+4 |
| * | optimize compound-literal sigset_t's not to contain useless hurd bits | Rich Felker | 2011-05-07 | 1 | -1/+1 |
| * | overhaul implementation-internal signal protections•••the new approach relies on the fact that the only ways to create
sigset_t objects without invoking UB are to use the sig*set()
functions, or from the masks returned by sigprocmask, sigaction, etc.
or in the ucontext_t argument to a signal handler. thus, as long as
sigfillset and sigaddset avoid adding the "protected" signals, there
is no way the application will ever obtain a sigset_t including these
bits, and thus no need to add the overhead of checking/clearing them
when sigprocmask or sigaction is called.
note that the old code actually *failed* to remove the bits from
sa_mask when sigaction was called.
the new implementations are also significantly smaller, simpler, and
faster due to ignoring the useless "GNU HURD signals" 65-1024, which
are not used and, if there's any sanity in the world, never will be
used.
| Rich Felker | 2011-05-07 | 1 | -2/+1 |
| * | use a separate signal from SIGCANCEL for SIGEV_THREAD timers•••otherwise we cannot support an application's desire to use
asynchronous cancellation within the callback function. this change
also slightly debloats pthread_create.c.
| Rich Felker | 2011-04-14 | 1 | -7/+25 |
| * | run pthread tsd destructors when a timer thread pretends to exit | Rich Felker | 2011-04-09 | 1 | -0/+6 |
| * | greatly improve SIGEV_THREAD timers•••calling pthread_exit from, or pthread_cancel on, the timer callback
thread will no longer destroy the timer.
| Rich Felker | 2011-04-09 | 1 | -14/+14 |
| * | fix signal-based timers with null sigevent argument•••since timer_create is no longer allocating a structure for the timer_t
and simply using the kernel timer id, it was impossible to specify the
timer_t as the argument to the signal handler. the solution is to pass
the null sigevent pointer on to the kernel, rather than filling it in
userspace, so that the kernel does the right thing. however, that
precludes the clever timerid-versus-threadid encoding we were doing.
instead, just assume timerids are below 1M and thread pointers are
above 1M. (in perspective: timerids are sequentially allocated and
seem limited to 32k, and thread pointers are at roughly 3G.)
| Rich Felker | 2011-04-06 | 1 | -19/+14 |
| * | timer threads should sleep and stay asleep... a long time | Rich Felker | 2011-04-03 | 1 | -1/+1 |
| * | revert to deleting kernel-level timer from cancellation handler•••this is necessary in order to avoid breaking timer_getoverrun in the
last run of the timer event handler, if it has not yet finished.
| Rich Felker | 2011-04-03 | 1 | -0/+8 |
| * | simplify calling of timer signal handler | Rich Felker | 2011-04-03 | 1 | -3/+1 |
| * | avoid all malloc/free in timer creation/destruction•••instead of allocating a userspace structure for signal-based timers,
simply use the kernel timer id. we use the fact that thread pointers
will always be zero in the low bit (actually more) to encode integer
timerid values as pointers.
also, this change ensures that the timer_destroy syscall has completed
before the library timer_destroy function returns, in case it matters.
| Rich Felker | 2011-03-30 | 1 | -20/+4 |
| * | optimize timer creation and possibly protect against some minor races•••the major idea of this patch is not to depend on having the timer
pointer delivered to the signal handler, and instead use the thread
pointer to get the callback function address and argument. this way,
the parent thread can make the timer_create syscall while the child
thread is starting, and it should never have to block waiting for the
barrier.
| Rich Felker | 2011-03-30 | 1 | -14/+19 |
| * | reorder timer initialization so that timer_create does not depend on free•••this allows small programs which only create times, but never delete
them, to use simple_malloc instead of the full malloc.
| Rich Felker | 2011-03-29 | 1 | -8/+16 |
| * | implement POSIX timers•••this implementation is superior to the glibc/nptl implementation, in
that it gives true realtime behavior. there is no risk of timer
expiration events being lost due to failed thread creation or failed
malloc, because the thread is created as time creation time, and
reused until the timer is deleted.
| Rich Felker | 2011-03-29 | 1 | -0/+110 |