summaryrefslogtreecommitdiffstats
path: root/lib/libkse/sys
Commit message (Collapse)AuthorAgeFilesLines
* When reinitializing a lockuser, don't assume that the lock is indeischen2008-01-311-7/+15
| | | | | | | | | use. If it is in use, use the watched request, otherwise use the lockuser's own request. Only allocate a lockuser request if both requests are null. PR: 119920 Tested by (6.x): Landon Fuller <landonf -at- bikemonkey -dot- org>
* Remove hacks to allow libkse to export its symbols in the LIBTHREAD_1_0deischen2007-12-161-2/+0
| | | | | version namespace which was needed before the library version was bumped.
* WARNS=3'ify.deischen2007-11-302-12/+15
|
* Add _pthread_mutex_init_calloc_cb() to libthr and libkse, so that malloc(3)jasone2007-11-272-4/+5
| | | | | (part of libc) can use pthreads mutexes without causing infinite recursion during initialization.
* Add compatibility symbol maps. libpthread (.so.1 and .so.2)deischen2006-03-131-0/+2
| | | | | | | | | | | used LIBTHREAD_1_0 as its version definition, but now needs to define its symbols in the same namespace used by libc. The compatibility hooks allows you to use libraries and binaries built and linked to libpthread before libc was built with symbol versioning. The shims can be removed if libpthread is given a version bump. Reviewed by: davidxu
* Catch up with the atomic_FOO_ptr() changes and silence a few warnings.deischen2005-07-291-7/+14
|
* Change the spin lock logic to a reasonable one. We should spin whendelphij2005-02-271-1/+1
| | | | | | | | | the lock is held by other thread, but not when nobody owns it. According to deischen@, this part of code will never be hit in our threads library, since it does not use locks without wait/wakeup functions. Spotted by: mingyanguo via ChinaUnix.net forum Reviewed by: deischen
* Use a generic way to back threads out of wait queues when handlingdeischen2004-12-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | signals instead of having more intricate knowledge of thread state within signal handling. Simplify signal code because of above (by David Xu). Use macros for libpthread usage of pthread_cleanup_push() and pthread_cleanup_pop(). This removes some instances of malloc() and free() from the semaphore and pthread_once() implementations. When single threaded and forking(), make sure that the current thread's signal mask is inherited by the forked thread. Use private mutexes for libc and libpthread. Signals are deferred while threads hold private mutexes. This fix also breaks www/linuxpluginwrapper; a patch that fixes it is at http://people.freebsd.org/~deischen/kse/linuxpluginwrapper.diff Fix race condition in condition variables where handling a signal (pthread_kill() or kill()) may not see a wakeup (pthread_cond_signal() or pthread_cond_broadcast()). In collaboration with: davidxu
* Add the ability to reinitialize libpthread's internal FIFO-queueingdeischen2003-11-042-15/+57
| | | | | | locks. Reviewed by: davidxu
* Only generate code for _LCK_ASSERT if _LCK_DEBUG is defined.davidxu2003-10-021-1/+6
|
* Don't assume sizeof(long) = sizeof(int) on x86; use intdeischen2003-09-032-12/+12
| | | | | | | | | | | | 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
* Move the machine specific files from sys/Makefile.inc and put themmarcel2003-06-231-4/+2
| | | | | in a machine specific makefile. While here, sort the sub-directories in Makefile and remove _atomic_lock.S from all makefiles.
* Attempt to eliminate PLT relocations from rwlock aquire/releasekan2003-05-301-0/+1
| | | | | | | | | | | path, making them suitable for direct use by the dynamic loader. Register libpthread-specific locking API with rtld on startup. This still has some rough edges with signals which should be addresses later. Approved by: re (scottl)
* Change low-level locking a bit so that we can tell ifdeischen2003-05-242-23/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | a lock is being waitied on. Fix a races in join and cancellation. When trying to wait on a CV and the library is not yet threaded, make it threaded so that waiting actually works. When trying to nanosleep() and we're not threaded, just call the system call nanosleep instead of adding the thread to the wait queue. Clean up adding/removing new threads to the "all threads queue", assigning them unique ids, and tracking how many active threads there are. Do it all when the thread is added to the scheduling queue instead of making pthread_create() know how to do it. Fix a race where a thread could be marked for signal delivery but it could be exited before we actually add the signal to it. Other minor cleanups and bug fixes. Submitted by: davidxu Approved by: re@ (blanket for libpthread)
* Add a method of yielding the current thread with the schedulerdeischen2003-05-162-29/+32
| | | | | | | | | | | | | | | | | | | | | | | lock held (_thr_sched_switch_unlocked()) and use this to avoid dropping the scheduler lock and having the scheduler retake the same lock again. Add a better way of detecting if a low-level lock is in use. When switching out a thread due to blocking in the UTS, don't switch to the KSE's scheduler stack only to switch back to another thread. If possible switch to the new thread directly from the old thread and avoid the overhead of the extra context switch. Check for pending signals on a thread when entering the scheduler and add them to the threads signal frame. This includes some other minor signal fixes. Most of this was a joint effor between davidxu and myself. Reviewed by: davidxu Approved by: re@ (blanket for libpthread)
* Protect against a race between granting a lock and accessingdeischen2003-05-042-7/+28
| | | | | | other parts of the lock. Submitted by: davidxu
* Protect thread errno from being changed while operatingdeischen2003-04-231-1/+5
| | | | | | | | on behalf of the KSE. Add a kse_reinit function to reinitialize a reused KSE. Submitted by: davidxu
* Sorry folks; I accidentally committed a patch from what I was workingdeischen2003-04-182-2/+2
| | | | | | on a couple of days ago. This should be the most recent changes. Noticed by: davidxu
* Add FIFO queueing locking operations based on atomic swap.deischen2003-04-184-7/+370
| | | | | | Modify thread errno for the new libpthread changes. Reviewed by: davidxu
* remove #ifdef _THREAD_SAFEfjoe2003-01-241-2/+0
|
* Use KSE to schedule threads.mini2002-10-301-2/+1
|
* Make the changes needed for libpthread to compile in its new home.mini2002-09-162-3/+3
| | | | | | | | The new libpthread will provide POSIX threading support using KSE. These files were previously repo-copied from src/lib/libc_r. Reviewed by: deischen Approved by: -arch
* $Id$ -> $FreeBSD$peter1999-08-282-2/+2
|
* Add RCS IDs to those files without them.deischen1999-08-051-0/+1
| | | | | | | Fix copyrights (s/REGENTS/AUTHOR). Suggested by: tg Approved by: jb
* Change the name of this source file so that libc_r builds it insteadjb1998-04-302-2/+52
| | | | | | of the one in libc that contains the weak symbol for __error. FreeBSD's make accumulates paths to the point that it can find *anything*, possibly including the car keys.
* Add spinlock.jb1998-04-291-3/+4
|
* Use libc makefiles from now on instead of duplicating them in libc_r.jb1997-05-031-128/+3
| | | | Added Id strings too. It's useful to know who last made a change.
* Sync with libc.alex1996-12-291-1/+1
| | | | Submitted by: John Birrell <jb@cimlogic.com.au>
* Submitted by: john birell (jb@cimlogic.com.au)julian1996-08-221-20/+20
| | | | | fixups for makefiles and for Thread-safe sycalls
* Submitted by: John Birrell <cimaxp1!jb@werple.net.au>julian1996-08-201-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here are the diffs for libc_r to get it one step closer to P1003.1c These make most of the thread/mutex/condvar structures opaque to the user. There are three functions which have been renamed with _np suffixes because they are extensions to P1003.1c (I did them for JAVA, which needs to suspend/resume threads and also start threads suspended). I've created a new header (pthread_np.h) for the non-POSIX stuff. The egrep tags stuff in /usr/src/lib/libc_r/Makefile that I uncommented doesn't work. I think its best to delete it. I don't think libc_r needs tags anyway, 'cause most of the source is in libc which does have tags. also: Here's the first batch of man pages for the thread functions. The diff to /usr/src/lib/libc_r/Makefile removes some stuff that was inherited from /usr/src/lib/libc/Makefile that should only be done with libc. also: I should have sent this diff with the pthread(3) man page. It allows people to type make -DWANT_LIBC_R world to get libc_r built with the rest of the world. I put this in the pthread(3) man page. The default is still not to build libc_r. also: The diff attached adds a pthread(3) man page to /usr/src/share/man/man3. The idea is that without libc_r installed, this man page will give people enough info to know that they have to build libc_r.
* ``mv'' -> ``mv -f''wosch1996-05-071-6/+7
| | | | | ``rm'' -> ``rm -f'' so mv/rm may not ask for confirmation if you are not root
* Sync libc_r with libc changes..peter1996-05-051-3/+3
|
* Reviewed by: julianjulian1996-01-221-0/+107
Submitted by: john birrel One version of the pthreads library another will follow with differnt actions under some cases.. not QUITE complete
OpenPOWER on IntegriCloud