Home | History | Annotate | Download | only in libpthread
History log of /src/lib/libpthread/pthread.h
RevisionDateAuthorComments
 1.41  20-Feb-2018  kamil Remove namespace restriction from pthread_condattr_{g,s}etclock(3)

These functions were marked as _NETBSD_SOURCE when introduced to the
sources. In fact they are regular POSIX threading functions available
since the 2001 standard. There is an older mention about alignment with
"IEEE Std 1003.1j-2000".

This corrects usage of these functions when a source code is compiled
with a POSIX namespace option.
 1.40  06-Feb-2018  christos fix duplicate declaration of pthread_atfork in unistd.h
 1.39  26-Dec-2017  christos Needs to be protected since it has a timespec argument. Found by lint(1)
 1.38  30-Oct-2016  kamil branches: 1.38.6;
POSIX harder the pthread_mutex_timedlock(3) prototype

Add missing __restrict keyword to the first pointer parameter.

It was already used for the second argument, should not be a functional
change and generated code should be the same.

This new form is now aligned with POSIX.
 1.37  03-Jul-2016  christos branches: 1.37.2;
GSoC 2016 Charles Cui: Implement thread priority protection based on work
by Andy Doran. Also document the get/set pshared thread calls as not
implemented, and add a skeleton implementation that is disabled.
XXX: document _sched_protect(2).
 1.36  23-Apr-2016  christos Add pthread_getcpuclockid(3)
 1.35  03-Nov-2012  christos add pthread_condattr_setclock(3)
 1.34  06-Aug-2010  christos branches: 1.34.6; 1.34.8; 1.34.12;
Add pthread_getattr_np()
 1.33  11-Jan-2009  christos merge christos-time_t
 1.32  18-Jul-2008  pooka branches: 1.32.6;
add pthread_cond_has_waiters_np()
 1.31  05-Jun-2008  ad Back out previous because it breaks the build.
 1.30  05-Jun-2008  ad glibc compatibile PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, requested by
rafal@.
 1.29  28-Apr-2008  martin branches: 1.29.2;
Remove clause 3 and 4 from TNF licenses
 1.28  26-Jan-2008  rmind branches: 1.28.4;
sched_setparam: fix the case when incorrect (according to the class)
in-kernel priority is used. Reported by <drochner>.

Minor fixes for scheduling calls to conform the POSIX:
- If pid is equal to zero, use the calling process;
- In case of permission problem, return EPERM instead of EACESS;
- sched_setscheduler() should return previously used policy;
- pthread_* calls should return the error code or zero;

Should fix the namespace problems (and builds of some packages):
- Move cpuset_t defintion from pset.h to sched.h;
- Remove the #include of pset.h in pthread.h;
 1.27  19-Jan-2008  christos s/set/test/
 1.26  19-Jan-2008  christos only include <sys/pset.h> if _NETBSD_SOURCE
 1.25  15-Jan-2008  rmind Implementation of processor-sets, affinity and POSIX real-time extensions.
Add schedctl(8) - a program to control scheduling of processes and threads.

Notes:
- This is supported only by SCHED_M2;
- Migration of LWP mechanism will be revisited;

Proposed on: <tech-kern>. Reviewed by: <ad>.
 1.24  24-Dec-2007  ad - Fix pthread_rwlock_trywrlock() which was broken.

- Add new functions: pthread_mutex_held_np, mutex_owner_np, rwlock_held_np,
rwlock_wrheld_np, rwlock_rdheld_np. These match the kernel's locking
primitives and can be used when porting kernel code to userspace.

- Always create LWPs detached. Do join/exit sync mostly in userland. When
looped on a dual core box this seems ~30% quicker than using lwp_wait().
Reduce number of lock acquire/release ops during thread exit.
 1.23  27-Nov-2007  ad Add thr_curcpu(), pthread_curcpu_np().
 1.22  14-Nov-2007  drochner Add pthread_equal() to libc stubs; this makes a lot of sense for
threadsafe libraries implementing own locking functions.
Ride on yesterday's minor version bumps.
 1.21  21-Mar-2005  kleink branches: 1.21.12;
Add restrict qualifiers to <pthread.h> function arguments.
 1.20  29-Dec-2004  nathanw branches: 1.20.2;
Implement pthread_attr_{set,get}schedpolicy() at the same level as the other
scheduling stuff: only handle SCHED_OTHER. Like the rest of the scheduling
stuff, this is for the benefit of code that can't be bothered to test against
_POSIX_THREAD_PRIORITY_SCHEDULING.
 1.19  15-Dec-2004  wiz Fix typo in comment.
 1.18  13-Dec-2004  nathanw Add #defines to make use of libc stubs for pthread_cond_wait() and
pthread_cond_timedwait().

XXX as noted in the comments, in the situations where these are
useful, they should never be called in a single-threaded
process. Perhaps they should die rather than return 0.

Addresses xsrc/28630.
 1.17  10-Dec-2004  nathanw Use CPP macros to cause many libpthread functions used by applications
to be transformed into the do-nothing-when-libpthread-isn't-linked libc
stub names. This will permit library code that uses <pthread.h> and pthread
functions "defensively" to not need to link against libpthread and not need
to be patched to the threadlib.h API.
 1.16  07-Dec-2003  christos Add pthread_{g,s}etschedparam, that do nothing.
 1.15  09-Nov-2003  christos Add:

int pthread_attr_setcreatesuspend_np(pthread_attr_t *);
int pthread_suspend_np(pthread_t);
int pthread_resume_np(pthread_t);

needed for java. Approved and fixed by cl.
 1.14  18-Jul-2003  nathanw Add prototypes and necessary symbols for a bunch of pthread_attr_*() functions,
including (interface borrowed from FreeBSD) pthread_attr_get_np().

Remove a few limit-indicating symbols that don't actually need to be defined
(and if they did need to be defined, it would be in limits.h, not here).
 1.13  18-Jul-2003  lukem #include <pthread_types.h> instead of "pthread_types.h"
 1.12  17-Jul-2003  nathanw Define PTHREAD_* structure initializers from _PTHREAD_* macros from
pthread_types.h.
 1.11  16-Jul-2003  nathanw pthread_kill() prototype moved to <signal.h>.
 1.10  02-Jun-2003  christos Add pthread_attr_getstack{,size,addr} needed by jdk
 1.9  26-Feb-2003  thorpej Add support for naming a thread, using an API compatible with Tru64 Unix:
* pthread_attr_getname_np()
* pthread_attr_setname_np()
* pthread_getname_np()
* pthread_setname_np()

In addition to being query'able by the application (for log messages, etc.),
it is intended that these names can show up in the debugger.

Reviewed by nathanw.
 1.8  13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.7  19-Jan-2003  thorpej Remove the dummy stack attr routines -- best to catch broken applications
and fix them to use the proper feature test instead (as has already been
done with the openldap package).
 1.6  19-Jan-2003  skrll Move _POSIX_THREADS to the right place and define a few other symbolic
constants for the features we gained with the merge of the nathanw_sa
branch.

Ok'd by thorpej.

Closes my PR 19930.
 1.5  19-Jan-2003  wiz Remove another variable name.
 1.4  19-Jan-2003  christos - constify the get functions
- remove argument variable names since they pollute the namespace
- add mock implementation of the missing stack functions
XXX: we need to do this right [i.e. actually get and set sizes and addresses]
but the current stack setup makes this a bit complicated.
 1.3  19-Jan-2003  jdolecek 'destructor' is a bit too generic; use 'destruct' instead for
pthread_key_create() prototype
this fixes compilation of Python 2.2 with thread support
XXX perhaps should drop all variable names from prototypes?
 1.2  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1  05-Mar-2001  nathanw branches: 1.1.2;
file pthread.h was initially added on branch nathanw_sa.
 1.1.2.21  16-Jan-2003  thorpej * Move the pthread_sigmask() prototype to <signal.h>.
* Don't include <signal.h> in <pthread.h>.
* Add code to the signal trampoline to convert from the ucontext
to a sigcontext, and back again (XXX though, only callee-save
regs for _UC_USER contexts).

This is necessary in order to support e.g. GCC's libjava, which depends
on the traditional Unix semantics of changes made to the sigcontext
being visible when the handler returns.
 1.1.2.20  13-Jan-2003  thorpej Implement recursive and errorcheck mutexes.
 1.1.2.19  08-Jan-2003  thorpej Rewrite the way libpthread provides thread primitives to libc, using
strong and weak aliases (the way cancelation points are handled).

Work around lame Unix static library semantics which could cause
the wrong thread primitives or cancelation point functions to be
included in a statically-linked program.

THIS IS AN ABI CHANGE. People running the nathanw_sa branch should
ensure that their libc and libpthread are in sync after updating.
 1.1.2.18  07-Jan-2003  thorpej Implement the pthread_barrier API.
 1.1.2.17  03-Nov-2002  skrll Whitespace in comments
 1.1.2.16  01-Nov-2002  thorpej * Default to a 100mS round-robin timer; there are a great many
applications that assume concurrency even on a uniprocessor.
(These applications are, of course, broken, but there's not
much we can do about it.)
* Add pthread_getrrtimer_np() and pthread_setrrtimer_np() functions
which provide access to the round-robin timer to application programs.
Setting the rrtimer to 0 will disable timeslicing.

Per discussion with Loren Rittle (on libstdc++@gcc.gnu.org) and
Nathan Williams (privately). The 100mS default interval is chosen
because timeslicing is largely for user-visible parallelism, and
the 100mS interval results in less overhead while still providing
a reasonable amount of user-visible parallelism.
 1.1.2.15  28-Oct-2002  nathanw Implement POSIX read-write locks.
 1.1.2.14  27-Oct-2002  thorpej Remove duplicate <sched.h>
 1.1.2.13  27-Oct-2002  thorpej Cosmetic changes.
 1.1.2.12  24-Jun-2002  nathanw C++ protection.
From Nick Hudson.
 1.1.2.11  02-May-2002  nathanw Different way of integrating with libc: Create a vector type for pthread
operations; libc will have a pointer to such a vector. When the pthread
library is loaded, set libc's pointer to a vector of real operations.
This removes the reliance on weak symbol magic, which didn't work
for static binaries, and as an aesthetic side effect, we don't have to
export a bunch of ugly _libc_pthread_* wrappers.
 1.1.2.10  25-Mar-2002  nathanw Provide interfaces to libc.
 1.1.2.9  01-Mar-2002  nathanw Declare POSIX spinlock interfaces: pthread_spin_*() and pthread_spinlock_t.
Move the internal spinlock interface declarations back to the internal header.
 1.1.2.8  28-Jan-2002  nathanw Cancellation support.
This includes implementing pthread_cancel() and pthread_testcancel(),
making pthread_join() and pthread_cond_wait() cancellation points,
introducing new states to distinguish waiting on a sleep queue
from waiting in the kernel, and introducing a locking protocol around
changing a thread's run state.
 1.1.2.7  30-Dec-2001  nathanw Declare cancellation routines and define cancellation constants.
Define pthread_cleanup_push() and pthread_cleanup_pop().
Rename pt_spin_t to pthread_spin_t.
Add pthread__errno() interface, for use by libc.
 1.1.2.6  08-Aug-2001  nathanw Add the __noreturn__ attribute to pthread_exit().

Add pthread_once and thread-specific data functions.

Expose pthread spinlock functions.
 1.1.2.5  06-Aug-2001  nathanw broadacst->broadcast
(Regression tests can also catch spelling errors!)
 1.1.2.4  25-Jul-2001  nathanw Remove obsolete PTHREAD_COND_INITIALIZER definition.
Add pthread_mutexattr_{init,destroy}().
Remove optional pthread_condattr functions.
 1.1.2.3  13-Jul-2001  nathanw Note copyright.
Standardize RCS IDs.
 1.1.2.2  13-Jul-2001  nathanw Move some of the more internal types to another file, to improve
readability.

C sucks, or I'd take them out of the application visibility completely.
 1.1.2.1  05-Mar-2001  nathanw The beginnings of a scheduler activations-based pthread library.
 1.20.2.1  22-Mar-2005  tron Pull up revision 1.21 (requested by kleink in ticket #46):
Add restrict qualifiers to <pthread.h> function arguments.
 1.21.12.2  23-Mar-2008  matt sync with HEAD
 1.21.12.1  09-Jan-2008  matt sync with HEAD
 1.28.4.1  18-May-2008  yamt sync with head.
 1.29.2.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.32.6.2  05-Jan-2009  christos protect functions that use timespec, but don't bother defining compat versions
since we are going to bump. Fixes lint issues in libc.
 1.32.6.1  18-Jul-2008  christos file pthread.h was added on branch christos-time_t on 2009-01-05 01:28:26 +0000
 1.34.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.34.8.1  28-Nov-2012  riz Pull up following revision(s) (requested by christos in ticket #722):
lib/libpthread/pthread_cond.c: revision 1.58
lib/libpthread/pthread_condattr.3: revision 1.8
lib/libpthread/pthread.h: revision 1.35
add pthread_condattr_setclock(3)
 1.34.6.1  16-Jan-2013  yamt sync with (a bit old) head
 1.37.2.1  04-Nov-2016  pgoyette Sync with HEAD
 1.38.6.1  25-Feb-2018  snj Pull up following revision(s) (requested by kamil in ticket #562):
lib/libpthread/pthread.h: 1.41
Remove namespace restriction from pthread_condattr_{g,s}etclock(3)
These functions were marked as _NETBSD_SOURCE when introduced to the
sources. In fact they are regular POSIX threading functions available
since the 2001 standard. There is an older mention about alignment with
"IEEE Std 1003.1j-2000".
This corrects usage of these functions when a source code is compiled
with a POSIX namespace option.

RSS XML Feed