summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/uthread/uthread_mutex.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove mutext from list of held mutexes in _mutex_reinit(). Correctskurt2009-10-281-2/+9
| | | | | a failure to lock the _atfork_mutex after forking. Tested by ajacoutot@ and myself. okay guenther@
* _FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, sokurt2007-06-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | isolate its usage to libpthread only and replace with generic non-static mutex support in the one place it is needed: - remove _FD_LOCK/UNLOCK from lseek and ftruncate in libc and make the functions weak so that libpthread can override with its own new versions that do the locking. - remove _thread_fd_lock/unlock() weak functions from libc and adjust libpthread for the change. - add generic _thread_mutex_lock/unlock/destroy() weak functions in libc to support non-static mutexes in libc and add libpthread and librthread implementations for them. libc can utilize non-static mutexes via the new _MUTEX_LOCK/UNLOCK/DESTROY() macros. Actually these new macros can support both static and non-static mutexes but currently only using them for non-static. - make opendir/closedir/readdir/readdir_r/seekdir/telldir() thread-safe for both thread libraries by using a non-static mutex in the struct _dirdesc (typedef DIR), utilizing it in the *dir functions and remove remaining and incorrect _FD_LOCK/UNLOCK() use in libc. - add comments to both thread libraries to indicate libc depends on the current implementation of static mutex initialization. suggested by marc@ - major bump libc and libpthread due to function removal, structure change and weak symbol conversions. okay marc@, tedu@
* lint warning corrections:kurt2007-05-011-2/+2
| | | | | | | - use the correct types - mark _thread_gc() w/ARGSUSED - fix a 'a cast does not yield an lvalue' okay marc@
* fix thread_continuation_t typedef and use passed curthread instead ofkurt2007-04-271-2/+2
| | | | calling _get_curthread() again. fixes some lint warnings. okay marc@
* - Prefix MUTEX_TYPE_MAX with PTHREAD_ to avoid namespace pollution.brad2005-10-311-2/+2
| | | | | | | | - Remove the macros MUTEX_TYPE_FAST and MUTEX_TYPE_COUNTING_FAST. From stefanf FreeBSD ok fgsch@
* Create a siginfo_t for thread-to-thread kill.marc2003-01-311-84/+1
| | | | | Clean up (compiler warning elimination). Compile check options added but commented out as they have not been checked on all architectures, yet.
* pthreads signal handling improvements. With these changes allmarc2003-01-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* signal handling changes. This corrects several signalmarc2002-10-301-22/+1
| | | | | | | 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.
* From FreeBSD:fgsch2002-01-231-199/+402
| | | | | | | o Use _get_curthread() instead of _thread_run. o Correctly deal with cancellations. o Add libc internal versions of pthread_mutex_lock() and pthread_mutex_trylock(), unused by now.
* a better fix for recursive mutex.fgsch2001-11-121-16/+4
|
* This fixes the recursive mutex problem with pthreads.marc2001-11-121-2/+14
| | | | | | fgs@ says their is a better fix... if so he can back these changes out and apply his fix at his convenience. In the meanwhile we'll have mutexen that work.
* oopsd2000-01-061-3/+2
|
* SPINLOCK_INIT, volatiled2000-01-061-5/+7
|
* sync with FreeBSDd1999-11-251-80/+128
|
* sync with freebsdd1999-06-091-1/+19
|
* sync with FreeBSDd1999-05-261-190/+1071
|
* identd1999-01-061-2/+6
|
* typod1998-12-231-1/+1
|
* comply with posix when double-unlocking a mutexd1998-12-181-2/+2
|
* sync with FreeBSDd1998-12-101-20/+47
|
* sync with freebsdd1998-11-201-10/+8
|
* experimental threaded libc - kernel onlyd1998-08-271-0/+389