summaryrefslogtreecommitdiff
path: root/lib/libpthread
AgeCommit message (Collapse)Author
2003-02-14- save and restore %fsr, too.Jason Wright
- better function descriptions
2003-02-14fix bug that would leave an FD locked if dup'd, then closed.Marco S Hyman
Also, for safety lock the _thread_fd_table when removing entries.
2003-02-14white spaceMarco S Hyman
2003-02-10priviledged -> privileged from David Krause via Henning BrauerMarco S Hyman
2003-02-05AARRGGH! 2nd try, handle the case where from_fd == to_fd in ↵Marco S Hyman
_thread_fd_table_dup
2003-02-05handle the case where from_fd == to_fd in _thread_fd_table_dupMarco S Hyman
2003-02-05thread fd handling, part 2. Don't mung file flags until forcedMarco S Hyman
to notice that the file exists. This fixes a problem where an application may think a file was in non-block mode because the threads kernel played with the flags. Also fix a stupid error introduced in the last commit -- the threaded version of dup and dup2 were foobared. Bad marc.
2003-02-04Part 1 of thread fd handling fixes. In the new scheme fd_table_entriesMarco S Hyman
for dup-ed fds are shared to ensure proper flag handling. A refcnt was added to control when entries should be freed. Specific changes: close: don't free entry unless refcnt is zero dup: rewrite to use new function _thread_fd_table_dup dup2: rewrite to use new function _thread_fd_table_dup fcntl: use _thread_fd_table_dup uthread_fd: initialize thread fd table, searching for dup-ed fds. Add function to share _thread_fd_table entries when an fd is dup-ed. uthread_init: make it readable. Call fd init functions. All current regression tests plus the mysql torture test pass. The new stdfiles regression test fails (I/O redirection problem). Part 2 is intended to fix that problem
2003-01-31typoTheo de Raadt
2003-01-31stuff in arch/sparc64 is by defn v9, remove < v9 #ifdefs. ok marc.Jason Wright
2003-01-31bad marc, commited crap to shut gcc up. Remove the crap.Marco S Hyman
2003-01-31Create a siginfo_t for thread-to-thread kill.Marco S Hyman
Clean up (compiler warning elimination). Compile check options added but commented out as they have not been checked on all architectures, yet.
2003-01-27pthreads signal handling improvements. With these changes allMarco S Hyman
of the thread regressions tests pass on i386, sparc, sparc64 (save the siginfo test on sparc64 due to a kernel issue) and alpha. The tests should also pass on ppc. In addition, it fixes the problems with the "mysql torture test" provided by one of our users. The python port also appears to work correctly with these changes. Summary of changes: * check_pending removed from thread structure, no longer used. * unused elements of sigstatus structure removed. The sigstatus structure is now used to keep track of siginfo data instead of defining a local array in uthread_sig.c. * _thread_kern_sched_sig removed * _thread_sig_process goes away -- can't have a lock active when signal handlers are called. Functions now call _thread_sig_handle directly. * _thread_clear_pending now used lib wide to clear pending flags. It was named _clean_pending_flag and only used in uthread_sig.c. The function clears both per thread signals, and per process signals. * _thread_sig_handle now returns a value. * unused debugging macros removed from the thread kernel * dispatch pending signals after switching to a thread providing that signal handling hasn't been deferred by the thread. * process thread switchhooks before dispatching pending sigs * check for thread cancellation before dispatching pending sigs * re-wrote pthread-kill to do the correct thing. It now does minimal thread-kill-specific processing and then calls the existing code in uthread_sig to process the generated signal. * shut the compiler up when compiling uthread_mutex.c * no more "signal_lock". It does more harm than good. * keep track of "per-process" signals. * don't bother saving siginfo_t data for the scheduling signal. * per posix: SIGSTOP cleared when SIGCONT received and vice versa. * add _dispatch_signal to properly dispatch a signal to a thread. It sets the appropriate signal mask, something that was missing in the previous implementation. This fixes several bugs. The previous method held a lock. If the signal handler longjmp-ed the lock was never cleared and no more signals were processed.
2003-01-27Save all floating point registers to full register sized fields, notDale Rahn
half-sized areas. fixes preemption_float on powerpc.
2003-01-26save fpu context (needs optimization)Jason Wright
2003-01-24On save:Jason Wright
If the fpu isn't enabled, don't save state, otherwise, save the state, mark both sides clean and disable the fpu. On restore: If the saved fpu state has the fpu disabled, do nothing, otherwise, restore everything.
2003-01-24Save FPU state (unconditionally)Jason Wright
2003-01-24save and restore fp state when switching threads. This, withMarco S Hyman
an arch/i386 patch previously commited and arch/sparc64 patches from jason@ make the preemption_float test pass on those two architectures. Do not run signal handlers for a thread until the thread has been made current, ensuring the proper context. Solves several (if not all) of the '_pq_insert_tail: Already in priority queue' problems.
2003-01-24save i386 fpu stateMarco S Hyman
2003-01-23stubs for functions needed by the vaxMarco S Hyman
2003-01-20remove libc_r mention in commentMarco S Hyman
2003-01-20Allow the fetching of current stack info from threaded apps.Marco S Hyman
This is necessary for alpha setjmp. The alpha setjmp/longjmp regression tests pass with -pthread with this change
2003-01-20Use the sources that exist in sibdirs of libpthread, not libc_rMarco S Hyman
2003-01-19return (func(...)) not needed when the current function and funcMarco S Hyman
are both void. The select call is a cancellation point per IEEE Std 1003.1-2001. This should fix a problem espie@ found in kde.
2003-01-16make it compileMichael Shalayeff
2003-01-14Bye-bye libc_r. libc_r and libnpthread go away. libpthreadMarco S Hyman
takes their place. The -pthread option to gcc uses libpthread. ppc portion of patch from drahn@ (thanks). gcc portions of patch OK espie@. Ports testing (no bad effects!) by naddy@ best build sequence is: build gcc, build system, build ports remove /usr/lib/lib{c_r,npthread}.*. Note, once libc_r and libnpthread is removed threaded ports will stop working until they have been re-built using the libpthread and the updated gcc. That's why the above build sequence is recommended.
2002-12-12use ldl_l/stl_c instead of ldq_l and ldq_c as _spinlock_lock_tMarco S Hyman
is defined as an int. This solves several alpha/pthread problems as repoted by various ports people.
2002-12-11add a debugging function not normally calledMarco S Hyman
2002-12-08remove unused data member from pthread_cond.Marco S Hyman
2002-12-03Crank all library major numbers. Needed due to the fact that weTodd C. Miller
now build libraries with propolice enabled. Without this, existing binaries (such as ports/packages) that link with any system library other than libc will fail with an undefined symbol of "___guard" (__guard on ELF). Pointed out by markus@ and discussed with deraadt@
2002-11-29Foward; torh@bogus.netTheo de Raadt
2002-11-21Add strerror_r and functions versions of getchar_unlocked andMarco S Hyman
putchar_unlocked. Crank the minor on related libs. OK fgs@, deraadt@
2002-11-16Enable libpthread, kind of....Marco S Hyman
The library is installed as libnpthread, not libpthread. This gets around broken autoconf ports that attempt to link using both -lpthread and -pthread. The next step will be to change the gcc -pthread flag to use this lib instead of libc_r.
2002-11-12get rid of compiler warningsMarco S Hyman
2002-11-12don't build with -g/-ggdb by default.Marco S Hyman
always build with -Wall bump version to 0.7 (matches libc_r x.7)
2002-11-12Fix the C version of atomic lock so that the compiler will not shareDale Rahn
registers. ok marc@
2002-11-09remove unused manpages (already in libc) and reorder SEE ALSO; marc@ ok.Federico G. Schwindt
2002-11-08kill two compiler warnings; ok marc@Todd T. Fries
2002-11-08Do not try to initialize entries in the fd table before the tableMarco S Hyman
is created.
2002-11-07Add needed table of strong functions that override weak functionsMarco S Hyman
in libc so static linking works with -lpthreads. There is a (linker?) problem that still shows up with static -pthread, though. Solution to problem from freebsd.
2002-11-07type func(...) -> type\nfunc(...) for function definitionsMarco S Hyman
2002-11-05thread safe libc -- 2nd try. OK miod@, millert@Marco S Hyman
Thanks to miod@ for m68k and vax fixes
2002-11-04test locks against _SPINLOCK_UNLOCKED, not 0. _SPINLOCK_UNLOCKED isMarco S Hyman
not zero on all arches
2002-11-03back out previous patch.. there are still some vax/m68k issuesMarco S Hyman
2002-11-03libc changes for thread safety. Tested on:Marco S Hyman
alpha (millert@), i386 (marc@), m68k (millert@ and miod@), powerpc (drahn@ and dhartmei@), sparc (millert@ and marc@), sparc64 (marc@), and vax (millert@ and miod@). Thanks to millert@, miod@, and mickey@ for fixes along the way.
2002-11-02Include string.h to get memcpy() prototype; OK marc@Todd C. Miller
2002-11-01Working atomic locks on vax for libc_r.Miod Vallat
ok marc@
2002-11-01md part for hppa should look like this, at the first lookMichael Shalayeff
2002-10-30removes duplicate functions and factor out common code so the needed (butMarco S Hyman
missing) _thread_fd_unlock_owned function can be added with minimal pain. The incorrect special handling of the stdio fds was also removed. Tested with the libc_r regression tests and the mysql regression tests. No complaints from any developers
2002-10-30signal handling changes. This corrects several signalMarco S Hyman
handling errors in the threads library. Most of the libc_r regression tests are now ok. thread specific kill semantics are still not correct. No negative comments after posting to tech@ a week or so ago. siginfo test fails on sparc64 due to sparc64 oddity.