summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
Commit message (Collapse)AuthorAgeFilesLines
...
* Add extra initialisation code that is required for processes thatjb1998-08-101-1/+29
| | | | | | | are started instead of init (pid = 1). This allows an embedded implementation quite like VxWorks, with (possibly) a single threaded program running instead of init. The neat thing is that the same threaded process can run in a multi-user workstation environment too.
* Changed prototype in synopsis to match prototype in <pthread.h>.bde1998-08-033-3/+3
|
* The pthreads standard has been published. Change:alex1998-08-0324-47/+47
| | | | | | | | | | ...is expected to conform to IEEE (``POSIX'') Std 1003.1c when it is published. to: ...conforms to ISO/IEC 9945-1 ANSI/IEEE (``POSIX'') Std 1003.1 Second Edition 1996-07-12. Discussed with: jb
* A style fix for my previous commit.alex1998-08-021-1/+1
|
* Fixed a race condition during the first lock/trylock of a staticallyalex1998-08-021-4/+21
| | | | | | | | | initialized mutex. Statically initialized mutexes are actually initialized at first use (pthread_mutex_lock/pthread_mutex_trylock). To prevent concurrent initialization by multiple threads, all static initializations are now serialized by a spinlock. Reviewed by: jb
* I've put together man pages for the pthread_cleanup, pthread_cond, andphk1998-07-3115-2/+951
| | | | | | | | pthread_mutex routines. I've also tweaked pthread_create.3 to point to pthread_cleanup_push(3) and pthread_cleanup_pop(3). PR: 7450 Submitted by: Brian Cully <shmit@kublai.com>
* Fixed a printf format error. Didn't fix assumption that sigset_t isbde1998-06-301-1/+1
| | | | integral.
* Add the missing {} that caused the function to return ESRCH if itjb1998-06-251-1/+2
| | | | | had to wait for the thread to exit and if the caller didn't want the thread exit status.
* Don't allow a SIGCHLD to wake up a thread if the process has the defaultjb1998-06-171-6/+9
| | | | | signal handler installed for SIGCHLD. The ACE MT_SOCK_Test was hanging as the result of being interrupted when it didn't expect to be.
* If a thread is waiting on a child process to complete, the SIGCHLDjb1998-06-171-1/+20
| | | | | | signal can arrive before the thread is woken from it's wait4. In this case, don't return an EINTR, just set the thread state to running and the wait4 wrapper will loop and get the exit status of the process.
* Don't compile in the use of poll() when building libc_r. This isn'tpeter1998-06-141-2/+2
| | | | | so much a "fix", rather a bandaid to buy time to fix it properly within the thread engine.
* If a short write, only loop if no error.jb1998-06-142-4/+4
|
* Add poll to the list of hidden syscalls so that it gets renamed. Thisjb1998-06-121-2/+2
| | | | | | | | | | | propagates a bug (that there is no poll wrapper in libc_r), but it prevents GNU configure scripts from trying to use it in preference to select. libc_r really needs to change it's wait interface to use poll instead of select because poll is more a superset of select that the other way around. This should allow the Roxen web server to work out-of-the-box. It's configuration intercae is kinda neat. The code isn't. Shiver. 8-)
* Update the caller's descriptor masks even if there are none ready forjb1998-06-121-1/+1
| | | | | I/O for those applications that don't believe the return value of zero as meaning that THERE ARE *NO* DESCRIPTORS READY.
* Check the access mode in the flags before waiting on a read or a writejb1998-06-104-4/+52
| | | | | that might never be possible if the file was not opened in the corrent mode. This prevents a hang for bad programs. Why do people code like that?
* Remove SA_RESTART from the signal dispatch in user-space since thisjb1998-06-101-92/+39
| | | | seems to be tripping up a lot of applications.
* When doing a F_SETFL, read the flags back so that the ones storedjb1998-06-101-3/+31
| | | | | in the file descriptor table are exactly what the kernel knows subject to the O_NONBLOCK flag being requested by the user.
* Add a commented out CFLAGS entry that can be uncommented to compile threadjb1998-06-091-1/+6
| | | | | lock debug into libc_r. I don't know if this is the best place to document this, but at least it is recorded somewhere. 8-)
* Implement compile time debug support instead of tracking file name andjb1998-06-0913-87/+94
| | | | | | | line number every time a file descriptor is locked. This looks like a big change but it isn't. It should reduce the size of libc_r and make it run slightly faster.
* Add support for compile time debug. This is enabled if libc_r is builtjb1998-06-091-20/+52
| | | | | | | | | | with -D_LOCK_DEBUG. This adds the file name and line number to each lock call and these are stored in the spinlock structure. When using debug mode, the lock function will check if the thread is trying to lock something it has already locked. This is not supposed to happen because the lock will be freed too early. Without lock debug, libc_r should be smaller and slightly faster.
* POSIX says that pthread_exit() is not allowed to be called from ajb1998-06-091-0/+10
| | | | | | | | cleanup destructor, so trap this case to prevent me from being being burnt again by applications that try to do this. With this change, an application (like one using a mis-configured ACE) will exit the process after displaying a message quoting the POSIX section that the application has violated.
* Add compile time thread lock debug support.jb1998-06-091-6/+21
| | | | | Add a thread specific flag to trap the case where pthread_exit() is called from a destructor in violation of the Posix standard.
* Delete the atomic unlock function since it is no longer required.jb1998-06-091-15/+5
| | | | | Simplify the atomic lock to just write a value of 1 to the lock instead of taking the value passed by the caller (which just confused things).
* Atomic lock asm code for the alpha version of libc_r.jb1998-06-091-0/+57
|
* Add a warning message for a thread locking against itself. This isjb1998-06-061-3/+14
| | | | | not supposed to happen, but I have seen bogus g++ code that causes it.
* Simplify the handling of thread specific data. Only track if a keyjb1998-06-061-45/+33
| | | | | | is allocated or not, rather than keeping a count and attempting to know it it is in-use. POSIX says that once a key is deleted, using the key again results in undefined behaviour.
* Re-design the thread specific key structure.jb1998-06-061-3/+2
|
* I got the last commit back to front.jb1998-06-061-3/+3
|
* Fix the signal behaviour for internal states which set the threadjb1998-06-051-6/+51
| | | | | state to running despite the SA_RESTART flag which is really just for syscalls.
* I shouldn't do things early in the morning.jb1998-06-011-3/+1
| | | | | | I shouldn't do things early in the morning. [...] I shouldn't do things early in the morning.
* send and recv are wrappered in libc, so they shouldn't appear here.jb1998-06-011-3/+3
|
* Remove some syscalls that should have been renamed (libc_r doesn't needjb1998-05-311-6/+6
| | | | to wrapper them) and add a couple that should have been there.
* Add some missing syscall wrappers.jb1998-05-311-1/+5
|
* Remove some stale code.jb1998-05-311-1/+1
| | | | Pointed out by: Amancio
* Don't restart a syscall when a SIGCHLD is received by a thread waitingjb1998-05-311-1/+6
| | | | on a child process.
* Make a copy of the caller's iovec array, mallocing if necessary,jb1998-05-271-14/+62
| | | | | and modify that if the writev() syscall does not completely write all bytes in a single call.
* When doing a blocking write, keep looping until all the bytes arejb1998-05-252-20/+106
| | | | | | | written without returning to the caller. This only occurs on pipes where either the number of bytes written is greater than the pipe buffer or if there is insufficient space in the pipe buffer because the reader is reading slower than the writer is writing.
* Treat the lock value as volatile.jb1998-05-051-2/+2
|
* Typo fixesjraynard1998-05-031-2/+3
|
* Cleanup in the child, not the parent.jb1998-05-021-2/+2
| | | | Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no>
* Fix the incremental priority increment.jb1998-04-301-2/+2
| | | | PR: bin/6467 Marino Ladavac <lada@pc8811.gud.siemens.at>
* 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
|
* Change signal model to match POSIX (i.e. one set of signal handlersjb1998-04-2938-1224/+865
| | | | | | | | | | | | | | | | | | | | for the process, not a separate set for each thread). By default, the process now only has signal handlers installed for SIGVTALRM, SIGINFO and SIGCHLD. The thread kernel signal handler is installed for other signals on demand. This means that SIG_IGN and SIG_DFL processing is now left to the kernel, not the thread kernel. Change the signal dispatch to no longer use a signal thread, and call the signal handler using the stack of the thread that has the signal pending. Change the atomic lock method to use test-and-set asm code with a yield if blocked. This introduces separate locks for each type of object instead of blocking signals to prevent a context switch. It was this blocking of signals that caused the performance degradation the people have noted. This is a *big* change!
* Atomic lock source.jb1998-04-291-0/+55
|
* Allow a thread dump to report the thread's sigmask when in thejb1998-04-171-0/+4
| | | | PS_SIGWAIT state.
* When in PS_SIGWAIT state, still call signal handlers and set errnojb1998-04-171-13/+2
| | | | to EINTR.
* Change the FILE locking to be by FILE, not by the underlying fd asjb1998-04-114-11/+39
| | | | | | | | | | | | | it was. Add a FILE_WAIT state and queue threads waiting for a FILE lock. Start using the sys/queue.h macros instead of the way that MIT pthreads did it. Add a thread name to the private thread structure and a non-POSIX function to set this. This helps (me at least) when sending a SIGINFO to a threaded process to get a /tmp/uthread.dump to see what the <expletive deleted> threads are doing this time. It is nice to be able to recognise (yes, I spell that with an 's' too) which threads are which.
* Enable static initialisation of mutexes and condition variables.jb1998-04-042-8/+32
|
* Rename static initializer defines for opaque structures so that thejb1998-04-041-2/+2
| | | | POSIX specified names can be declared in pthread.h.
OpenPOWER on IntegriCloud