summaryrefslogtreecommitdiff
path: root/lib/libpthread
AgeCommit message (Collapse)Author
2006-09-29powerpc stack needs a bit more headroom; needed because of mmap()edOtto Moerbeek
stacks; report by Antoine Jacoutot; ok kurt@
2006-09-26style(9) extra spaceKurt Miller
2006-09-26- Use mmap to allocate thread stacks instead of malloc. This preventsKurt Miller
applications that install their own thread stack red-zones with mprotect PROT_NONE from entering the malloc pool when the pages are freed. - round up requested thread stack size to closest page boundary to simplify the red-zone calculations. okay brad@
2006-09-26Part 2 of file descriptor race and deadlock corrections.Kurt Miller
Adjust design of file descriptor table to eliminate races with both opening and closing of file descriptor entries and eliminates one class of deadlocks. One nice side effect of this change in design should be better performance for applications that open and close many file descriptors due to reduced fd_table_lock contention and fd entry reuse. - Add entry states to manage use of entry and eliminate some closing races. fd entries are not deallocated upon close() now. - Call _thread_fd_table_init with one of five discreet modes to properly initialize an entry and manage the state transition to open. - When closing an entry hold the entry spinlock locked across the state transition and the _thread_sys_close call to close another race. - Introduce a new lock type FD_RDWR_CLOSE that transitions either a closed entry or an open entry into closing state and then waits for a RDWR lock so that the lock queue can unwind normally. All subsequent fd lock attempts for that entry are rejected with EBADF until the fd is fully closed, or reopened by dup2(). Once a thread holds the FD_RDWR_LOCK it is safe to close() it or dup2() on it. - When a thread creates a new fd there is a window of time when another thread could attempt to use the fd before the creating thread has initialized the entry for it. This can result in improper status_flags for the entry, so record the entries init mode, detect when this has happened and correct the status_flags when needed. reviewed by marc@ & brad@, tested by several, okay brad@
2006-09-23fix a bug where the logic was reversedKurt Miller
2006-09-22Part 1 of file descriptor race and deadlock corrections.Kurt Miller
File status flags should be shared for dup'ed file descriptors. However fd_table_entry's should not be shared for dup'ed file descriptors so they can be independently be closed without interfering with dup'ed fd's. - split out file status flags into its own structure fs_flags to manage sharing of status flags between dup'ed file descriptors. - when duplicating a fd, initialize a new fd_table_entry for the new fd, but share the status flags via status_flags. - consolidate the code that sets the underlying system fd to be non-blocking to a new function _thread_fs_flags_init() - consolidate the code that sets the underlying system fd back to blocking into a new function _thread_fs_flags_replace() This change is needed as a prerequisite to the coming race and deadlock corrections. okay marc@
2006-05-30Bump minimum stack size; current setting causes hangs or illegalOtto Moerbeek
instructions once every few runs. Problem noted by Botond Botyanszki. ok marc@
2006-04-09Change a debug interface to take const char pointers so we don't aveKenneth R Westerback
to cast away constness whenever we want to pass in a string that is already const -- we copy the string if we want to use it, so having it be non-const in the first place does not make any sense. From tholo@ ok tedu@
2006-04-06- due to the fninit() in _thread_machdep_save_float_state() all calls toKurt Miller
it need to be matched with a call to _thread_machdep_restore_float_state(), so add missing one in _thread_machdep_init(). - 16-byte align fp frame - call fwait() before save and and after restoring fp state. lots of guidance and ok mickey@
2006-04-02malloc(x * y) -> calloc(x, y) from adobriyan AT gmail.com, with tweaksDamien Miller
suggested by kjell@; ok otto@ pat@ millert@ jaredy@
2006-03-06Add _thread_atexit_lock and _thread_atexit_unlock to the list ofOtto Moerbeek
weak functions; ok millert@.
2006-02-22Avouid a race in atexit() handling by introducing a lock. ProblemOtto Moerbeek
originally reported by Gergely Kovacs; help from dhartmei@; ok tedu@ millert@
2006-02-16cap seconds to 100 million per man page and kernel nanosleep impl.Kurt Miller
prevents userland from causing an overflow of tv_sec. okay marc@
2006-02-06typos from alexey dobriyan;Jason McIntyre
2006-01-06Adapt things to use __type_t instead of _BSD_TYPE_T_Todd C. Miller
Add new sys/_types.h header Include machine/_types.h or sys/_types.h where applicable
2005-12-21Userland programs should include <errno.h> not <sys/errno.h>Todd C. Miller
OK deraadt@
2005-12-14My email address changed quite a while ago...Dale Rahn
2005-11-25don't ask; ok drahnTheo de Raadt
2005-11-24use WANTLINT= (on all architectures)Theo de Raadt
2005-11-14revert this file to -r1.2, when it was originally written,Jason McIntyre
because of an unacceptable license: the file was originally written by david leonard, who has kindly agreed to us putting a (public domain) license on it: the original page did not contain any license. thanks david. this also includes some tweaks by me, so it does not exactly match revision 1.2.
2005-11-01a bit of rewording; with input from jmc@.Federico G. Schwindt
2005-10-31- Prefix MUTEX_TYPE_MAX with PTHREAD_ to avoid namespace pollution.Brad Smith
- Remove the macros MUTEX_TYPE_FAST and MUTEX_TYPE_COUNTING_FAST. From stefanf FreeBSD ok fgsch@
2005-10-31add copyright from the original FreeBSD man page.Brad Smith
2005-10-30remove trailing spaces;Jason McIntyre
2005-10-30shuffle some of the function names around into new section names.Brad Smith
2005-10-30and make sure the header change goes in too.Brad Smith
2005-10-30Add pthread_atfork(3)Brad Smith
From FreeBSD 'looks ok' fgsch@ miod@ man page reviewed by jmc@
2005-10-30Don't use TAILQ_NEXT() on an element that has been removed. Similar toKenneth R Westerback
otto@'s diff for uvm_aobj.c. Identical to a diff canacar@ developed independantly. ok brad@ 'looks correct' fgsch@
2005-10-29Don't use TAILQ_NEXT() on an element that has been removed. Similar toKenneth R Westerback
otto@'s diff for uvm_aobj.c. ok deraadt@ pedro@
2005-10-14Use queue macros instead of directly accessing fields. ok marc@ miod@Otto Moerbeek
patrick@
2005-10-12remove MLINKS for pthread_mutexattr_{g,s}etpshared.3:Jason McIntyre
these functions seem never to have existed, and are certainly not documented in pthread_mutexattr(3), the page to which they point.
2005-07-14- make sure sem_ pages reference each other (idea from similar freebsd commit)Jason McIntyre
- where two functions are documented in the same page, make sure we don;t reference them both in SEE ALSO. kind of annoying to call up a second man page and find it's the same as the last one (even more annoying to not realise two pages are the same till you've finished reading twice ;)...
2005-02-09document [EBUSY];Jason McIntyre
from freebsd pr #73887; ok marc@
2005-02-01typo; from axel andersson;Jason McIntyre
2005-01-28Grab the current time before calculating thread wake-up time.Marco S Hyman
Solves a problem where select/poll calls would return early without indicating any error. Tested by otto@ and kurt@ -- thanks.
2005-01-23Add debug support.Mark Kettenis
ok marc@
2004-12-12Avoid using void pointers in additive expressionsBrad Smith
From FreeBSD ok marc@
2004-11-30* make sure we leave the thread's cancellation point before we returnPatrick Latifi
* plug a memory leak and FD_UNLOCK properly in writev ok marc
2004-11-02Convert float register save to new 64 bit ABI requirements.Per Fogelstrom
2004-09-18Allow thread in FD{R,W}_WAIT states to be suspended.Marco S Hyman
Patch from Kurt Miller <truk at optonline.net> Commit reminder from millert@. OK brad@
2004-09-09 couple of changes (int -> long) to handle 64 bits.Per Fogelstrom
2004-08-11mips->mips64Per Fogelstrom
2004-08-11mips->mips64. ok deraadt@Per Fogelstrom
2004-07-13errno changes, lib major version bumps, and general flag dayMarco S Hyman
To build you must: cd /usr/src && make obj && make includes cd lib/libc && make depend && make && NOMAN=1 sudo make install cd /usr/src && make build
2004-06-24hsearch API/ABI u_int -> size_t -> crank majors; ok millertTheo de Raadt
2004-06-08missing include; ok marc@.Xavier Santolaria
2004-06-07major bump to libc and libpthread to break the dependency of aMarco S Hyman
particular implementation of libpthread for libc. libc no longer needs pthread.h to compile. OK millert@, brad@, tedu@
2004-05-03libc major number crankTodd C. Miller
2004-05-02bump minor for new functions. Reminder from brad@Marco S Hyman
2004-05-01pthead_supsend_all_np and pthread_resume_all_np from freebsd viaMarco S Hyman
Kurt Miller <truk at optonline.net>. Kurt says: They're needed for the java hotspot compiler in the 1.3+ jdk OK brad@