summaryrefslogtreecommitdiff
path: root/lib/libpthread/uthread/pthread_private.h
AgeCommit message (Collapse)Author
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-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-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-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.
2002-12-11add a debugging function not normally calledMarco S Hyman
2002-12-08remove unused data member from pthread_cond.Marco S Hyman
2002-11-12get rid of compiler warningsMarco S Hyman
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.
2002-02-21account for the process signal mask when dealing with signals; testedFederico G. Schwindt
a while ago by marc@ and brad@
2002-01-19Instead of ifdef around ENOTSUP, move it to pthread_private.h and makeFederico G. Schwindt
it EOPNOTSUPP.
2001-12-31More changes from FreeBSD, including:Federico G. Schwindt
o Only poll file descriptors when needed. o Change the way timing is achieved, counting scheduling ticks instead of calculating the elapsed time via gettimeofday(). o Prevent an overflow when polling. o Use curthread instead of _thread_run. o Remove extra spaces; indent.
2001-12-19More sync.Federico G. Schwindt
2001-12-11More sync with freebsd code; join related code this time.Federico G. Schwindt
2001-12-08Partially sync with FreeBSD; mostly pthread_cancel(3) related changes.Federico G. Schwindt
make includes is needed in case you want to play.
2001-09-04Use _waitq_remove() and _waitq_insert() always; from FreeBSD.Federico G. Schwindt
2001-09-04put changes back, this time ALL the files.Federico G. Schwindt
2001-08-30Back out fgsch@'s tree breaking commits.Todd T. Fries
Test next time, ok?
2001-08-30fix some const warnings.Federico G. Schwindt
more sync with freebsd.
2001-08-29More sync with FreeBSD.Federico G. Schwindt
2001-08-26More syncing with FreeBSD, preparing for a commit.Federico G. Schwindt
2001-08-21Start syncing with FreeBSD:Federico G. Schwindt
o Implement _get_curthread() and _set_curthread(). Use it where possible. o Add missing _thread_[enter|leave]_cancellation_point(). o Add a couple of not yet used vars to pthread_private.h. o Remove return's from void functions. This is by no means complete, but instead of doing a big commit, i'll split it in small ones, minimizing diffs.
2001-08-15* kevent(2) support; from FreeBSD.Federico G. Schwindt
* change _thread_kern_set_timeout() parm to const.
2000-12-06use __x__ formats for __attribute__ arguments; guenther@gac.eduTheo de Raadt
2000-10-04switch to _machdep_switch() instead of setjmp/longjmp. For some reason this ↵David Leonard
fixes sparc threads.
2000-01-06volatile; thread_private.h; locking defines moved out; kill(), getpid()David Leonard
1999-11-25sync with FreeBSDDavid Leonard
1999-09-08TAILQ_FOREACH now is in queue.hMarc Espie
1999-06-15Remove pthread_atfork(). It was only part of draft 10 for a little while and ↵David Leonard
was removed before stddization.
1999-06-09sync with freebsdDavid Leonard
1999-05-26sync with FreeBSDDavid Leonard
1999-02-16update prototypes now that socket functions take socklen_t as a length parameterTodd C. Miller
1999-01-18move private spinlock protos outDavid Leonard
1999-01-18sync with previous changesDavid Leonard
1999-01-10fix protoDavid Leonard
1999-01-08slight structure rearrange for gdb thread supportDavid Leonard
1999-01-08add fchflags and fpathconf as well.David Leonard
1999-01-08add poll(2). This might help get X threaded.David Leonard
1998-12-23preserve FreeBSD identsDavid Leonard
1998-12-21resource accountingDavid Leonard
1998-11-20sync with freebsdDavid Leonard
1998-11-20fix strcat usage; deraadtDavid Leonard
1998-11-09sync with FreeBSD (rwlock, gc thread, man pages)David Leonard
add (broken) mips md stuff fix some const warnings add sigaltstack() stub another hash at getting shlib auto-init to work (mips/elf and i386/a.out)
1998-08-27experimental threaded libc - kernel onlyDavid Leonard