History log of /freebsd-current/include/pthread_np.h
Revision Date Author Comments
# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 064c283d 04-Jun-2020 Konstantin Belousov <kib@FreeBSD.org>

Revert r361770 "Add pthread_getname_np() and pthread_setname_np() aliases" for now.

It is not compatible enough with Linux.

Requested by: antoine, jkim
Sponsored by: The FreeBSD Foundation


# 9bed49fe 03-Jun-2020 Konstantin Belousov <kib@FreeBSD.org>

Add pthread_getname_np() and pthread_setname_np() aliases

for pthread_get_name_np() and pthread_set_name_np(), to be
compatible with Linux.

PR: 238404
Proposed and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25117


# 132fb3dc 15-Feb-2020 Konstantin Belousov <kib@FreeBSD.org>

Add pthread_peekjoin_np(3).

The function allows to peek at the thread exit status and even see
return value, without joining (and thus finally destroying) the target
thread.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation (kib)
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D23676


# 4627d47b 17-Aug-2018 Konstantin Belousov <kib@FreeBSD.org>

Add pthread_get_name_np(3).

The function retrieves the thread name previously set by
pthread_set_name_np(3). The name is cached in the process memory.

Requested by: Willem Jan Withagen <wjw@digiware.nl>
Man page update: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: ian (previous version)
Discussed with: arichardson, bjk (man page)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16702


# d9cf2913 17-Aug-2018 Konstantin Belousov <kib@FreeBSD.org>

Reorder alphabetically.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D16702


# 2321c474 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

include: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# 678b238c 07-Feb-2011 Jung-uk Kim <jkim@FreeBSD.org>

Introduce a non-portable function pthread_getthreadid_np(3) to retrieve
calling thread's unique integral ID, which is similar to AIX function of
the same name. Bump __FreeBSD_version to note its introduction.

Reviewed by: kib


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# c3f43618 03-Mar-2008 David Xu <davidxu@FreeBSD.org>

Add cpu affinity APIs to get and set thread's cpu affinity mask, the
functions are intented to be are compatible with glibc.


# 1cbdac26 06-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Per discussion on -threads, rename _islocked_np() to _isowned_np().


# 5fd410a7 03-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Add pthread_mutex_islocked_np(), a cheap way to verify that a mutex is
locked. This is intended primarily to support the userland equivalent
of the various *_ASSERT_LOCKED() macros we have in the kernel.

MFC after: 2 weeks


# 093fcf16 13-Dec-2007 David Xu <davidxu@FreeBSD.org>

1. Add function pthread_mutex_setspinloops_np to turn a mutex's spin
loop count.
2. Add function pthread_mutex_setyieldloops_np to turn a mutex's yield
loop count.
3. Make environment variables PTHREAD_SPINLOOPS and PTHREAD_YIELDLOOPS
to be only used for turnning PTHREAD_MUTEX_ADAPTIVE_NP mutex.


# ca5c5174 28-Oct-2007 Warner Losh <imp@FreeBSD.org>

Remove 3rd clause and renumber after getting permission from the
author (quite some time ago).


# a48182f7 04-Oct-2005 David Xu <davidxu@FreeBSD.org>

Add pthread_timedjoin_np prototype.


# f7ed1917 07-Jan-2003 Max Khon <fjoe@FreeBSD.org>

pthread_attr_get_np() now takes 'pthread_t' (not 'pthread_t *')
to be consistent with other pthread_XXX functions


# 49d7a091 26-Oct-2002 Alexey Zelkin <phantom@FreeBSD.org>

Prototype for pthread_attr_get_np().


# 943dffc8 22-Oct-2002 Max Khon <fjoe@FreeBSD.org>

fix pthread_suspend/resume_all_np() declarations

Approved by: deischen


# 04249148 23-May-2002 Daniel Eischen <deischen@FreeBSD.org>

Reorder prototypes to be in alphabetical order.


# 9de68a9f 23-May-2002 Daniel Eischen <deischen@FreeBSD.org>

Add the prototypes for pthread_suspend_all_np and pthread_resume_all_np.


# bb28f3c2 23-Mar-2002 Warner Losh <imp@FreeBSD.org>

Breath deep and take __P out of the system include files.

# This appears to not break X11, but I'm having problems compiling the
# glide part of the server with or without this patch, so I can't tell
# for sure.


# e54b5dd9 10-Aug-2001 Warner Losh <imp@FreeBSD.org>

Make the name parameter const char *.


# 8360efbd 18-Mar-2001 Alfred Perlstein <alfred@FreeBSD.org>

Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.

Bring in required TLI library routines to support this.

Since we don't support TLI we've essentially copied what NetBSD
has done, adding a thin layer to emulate direct the TLI calls
into BSD socket calls.

This is mostly from Sun's tirpc release that was made in 1994,
however some fixes were backported from the 1999 release (supposedly
only made available after this porting effort was underway).

The submitter has agreed to continue on and bring us up to the
1999 release.

Several key features are introduced with this update:
Client calls are thread safe. (1999 code has server side thread
safe)
Updated, a more modern interface.

Many userland updates were done to bring the code up to par with
the recent RPC API.

There is an update to the pthreads library, a function
pthread_main_np() was added to emulate a function of Sun's threads
library.

While we're at it, bring in NetBSD's lockd, it's been far too
long of a wait.

New rpcbind(8) replaces portmap(8) (supporting communication over
an authenticated Unix-domain socket, and by default only allowing
set and unset requests over that channel). It's much more secure
than the old portmapper.

Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
to support TI-RPC and to support IPV6.

Umount(8) is also fixed to unmount pathnames longer than 80 chars,
which are currently truncated by the Kernel statfs structure.

Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul


# 026cb3a6 31-Jul-1999 Ralf S. Engelschall <rse@FreeBSD.org>

Cleanups to the pthread header files.

Submitted by: Ralf S. Engelschall <rse@engelschall.com>
Reviewed by: John Birrell <jb@cimlogic.com.au>


# b847980f 22-Mar-1999 John Birrell <jb@FreeBSD.org>

o Runnable threads are now maintained in priority queues. The
implementation requires two things:

1.) The priority queues must be protected during insertion
and removal of threads. Since the kernel scheduler
must modify the priority queues, a spinlock for
protection cannot be used. The functions
_thread_kern_sched_defer() and _thread_kern_sched_undefer()
were added to {un}defer kernel scheduler activation.

2.) A thread (active) priority change can be performed only
when the thread is removed from the priority queue. The
implementation uses a threads active priority when
inserting it into the queue.

A by-product is that thread switches are much faster. A
separate queue is used for waiting and/or blocked threads,
and it is searched at most 2 times in the kernel scheduler
when there are active threads. It should be possible to
reduce this to once by combining polling of threads waiting
on I/O with the loop that looks for timed out threads and
the minimum timeout value.

o Functions to defer kernel scheduler activation were added. These
are _thread_kern_sched_defer() and _thread_kern_sched_undefer()
and may be called recursively. These routines do not block the
scheduling signal, but latch its occurrence. The signal handler
will not call the kernel scheduler when the running thread has
deferred scheduling, but it will be called when running thread
undefers scheduling.

o Added support for _POSIX_THREAD_PRIORITY_SCHEDULING. All the
POSIX routines required by this should now be implemented.
One note, SCHED_OTHER, SCHED_FIFO, and SCHED_RR are required
to be defined by including pthread.h. These defines are currently
in sched.h. I modified pthread.h to include sched.h but don't
know if this is the proper thing to do.

o Added support for priority protection and inheritence mutexes.
This allows definition of _POSIX_THREAD_PRIO_PROTECT and
_POSIX_THREAD_PRIO_INHERIT.

o Added additional error checks required by POSIX for mutexes and
condition variables.

o Provided a wrapper for sigpending which is marked as a hidden
syscall.

o Added a non-portable function as a debugging aid to allow an
application to monitor thread context switches. An application
can install a routine that gets called everytime a thread
(explicitly created by the application) gets context switched.
The routine gets passed the pthread IDs of the threads that are
being switched in and out. I found this useful, but we can
get rid of it if you want.

Submitted by: Dan Eischen <eischen@vigrid.com>


# 1c1426e1 10-Apr-1998 John Birrell <jb@FreeBSD.org>

Add a function prototype to set the name of a thread for debugging
purposes.


# f756433e 07-May-1997 Eivind Eklund <eivind@FreeBSD.org>

Back out all of yesterdays include file changes.


# 48ea0bec 06-May-1997 Eivind Eklund <eivind@FreeBSD.org>

Make a lot of include-files self-contained. I excluded the patches changing
int's to gid_t and uid_t - should I commit these, too?

Closes PR misc/2625.

Submitted by: Julian Assange <proff@iq.org>


# 7d9120c4 11-Nov-1996 Jeffrey Hsu <hsu@FreeBSD.org>

Prototype pthread_mutexattr_getkind_np() and pthread_mutexattr_setkind_np().


# 0f7d6847 20-Aug-1996 Julian Elischer <julian@FreeBSD.org>

Submitted by: John Birrell <cimaxp1!jb@werple.net.au>

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.