<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libthr/thread/thr_create.c, branch releng/12.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2018-08-18T01:05:38Z</updated>
<entry>
<title>POSIX compliance improvements in the pthread(3) functions.</title>
<updated>2018-08-18T01:05:38Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2018-08-18T01:05:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b6413b6db8756c1ecae5e575e6516f811966046f'/>
<id>urn:sha1:b6413b6db8756c1ecae5e575e6516f811966046f</id>
<content type='text'>
This basically adds makes use of the C99 restrict keyword, and also
adds some 'const's to four threading functions: pthread_mutexattr_gettype(),
pthread_mutexattr_getprioceiling(), pthread_mutexattr_getprotocol(), and
pthread_mutex_getprioceiling. The changes are in accordance to POSIX/SUSv4-2018.

Hinted by:	DragonFlyBSD

Relnotes:	yes
MFC after:	1 month
Differential Revision:	D16722
</content>
</entry>
<entry>
<title>lib: further adoption of SPDX licensing ID tags.</title>
<updated>2017-11-26T02:00:33Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-11-26T02:00:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5e53a4f90f82c4345f277dd87cc9292f26e04a29'/>
<id>urn:sha1:5e53a4f90f82c4345f277dd87cc9292f26e04a29</id>
<content type='text'>
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

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.
</content>
</entry>
<entry>
<title>Use __FBSDID() for .c files from lib/libthr/thread.</title>
<updated>2016-04-08T11:15:26Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2016-04-08T11:15:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3279301186099f2fe0a3b98f05944434d84c056a'/>
<id>urn:sha1:3279301186099f2fe0a3b98f05944434d84c056a</id>
<content type='text'>
Sponsored by:	The FreeBSD Foundation
</content>
</entry>
<entry>
<title>Implement process-shared locks support for libthr.so.3, without</title>
<updated>2016-02-28T17:52:33Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2016-02-28T17:52:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1bdbd705993eab79189dff87b69a9cff5c69b17e'/>
<id>urn:sha1:1bdbd705993eab79189dff87b69a9cff5c69b17e</id>
<content type='text'>
breaking the ABI.  Special value is stored in the lock pointer to
indicate shared lock, and offline page in the shared memory is
allocated to store the actual lock.

Reviewed by:	vangyzen (previous version)
Discussed with:	deischen, emaste, jhb, rwatson,
	Martin Simmons &lt;martin@lispworks.com&gt;
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
</content>
</entry>
<entry>
<title>cosmetic: whitespaces-tab before EOL</title>
<updated>2015-07-08T16:35:24Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2015-07-08T16:35:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=850c6f5fd286dcbc99464c01e6e9d5cab6e5fc7c'/>
<id>urn:sha1:850c6f5fd286dcbc99464c01e6e9d5cab6e5fc7c</id>
<content type='text'>
Obtained from:	cpi-llvm project
</content>
</entry>
<entry>
<title>Fix known issues which blow up the process after dlopen("libthr.so")</title>
<updated>2015-01-03T18:38:46Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2015-01-03T18:38:46Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8495e8b1e9e13fb707296a486acf7538dbfa12b2'/>
<id>urn:sha1:8495e8b1e9e13fb707296a486acf7538dbfa12b2</id>
<content type='text'>
(or loading a dso linked to libthr.so into process which was not
linked against threading library).

- Remove libthr interposers of the libc functions, including
  __error(). Instead, functions calls are indirected through the
  interposing table, similar to how pthread stubs in libc are already
  done.  Libc by default points either to syscall trampolines or to
  existing libc implementations.  On libthr load, libthr rewrites the
  pointers to the cancellable implementations already in libthr.  The
  interposition table is separate from pthreads stubs indirection
  table to not pull pthreads stubs into static binaries.

- Postpone the malloc(3) internal mutexes initialization until libthr
  is loaded.  This avoids recursion between calloc(3) and static
  pthread_mutex_t initialization.

- Reinstall signal handlers with wrapper on libthr load.  The
  _rtld_is_dlopened(3) is used to avoid useless calls to sigaction(2)
  when libthr is statically referenced from the main binary.

In the process, fix openat(2), swapcontext(2) and setcontext(2)
interposing.  The libc symbols were exported at different versions
than libthr interposers.  Export both libc and libthr versions from
libc now, with default set to the higher version from libthr.

Remove unused and disconnected swapcontext(3) userspace implementation
from libc/gen.

No objections from:	deischen
Tested by:	pho, antoine (exp-run) (previous versions)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
</content>
</entry>
<entry>
<title>Implement the __pthread_map_stacks_exec() for libthr.</title>
<updated>2011-01-09T12:38:40Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2011-01-09T12:38:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=da2fcff746a151ab3ea26c237953a90236cfc176'/>
<id>urn:sha1:da2fcff746a151ab3ea26c237953a90236cfc176</id>
<content type='text'>
Stack creation code is changed to call _rtld_get_stack_prot() to get
the stack protection right. There is a race where thread is created
during dlopen() of dso that requires executable stacks. Then,
_rtld_get_stack_prot() may return PROT_READ | PROT_WRITE, but thread
is still not linked into the thread list. In this case, the callback
misses the thread stack, and rechecks the required protection
afterward.

Reviewed by:	davidxu
</content>
</entry>
<entry>
<title>add code to support stack unwinding when thread exits. note that only</title>
<updated>2010-09-15T02:56:32Z</updated>
<author>
<name>David Xu</name>
<email>davidxu@FreeBSD.org</email>
</author>
<published>2010-09-15T02:56:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3832fd24f1e8e607d4acce7dc001ff09944ebafc'/>
<id>urn:sha1:3832fd24f1e8e607d4acce7dc001ff09944ebafc</id>
<content type='text'>
defer-mode cancellation works, asynchrnous mode does not work because
it lacks of libuwind's support. stack unwinding is not enabled unless
LIBTHR_UNWIND_STACK is defined in Makefile.
</content>
</entry>
<entry>
<title>Convert thread list lock from mutex to rwlock.</title>
<updated>2010-09-13T07:03:01Z</updated>
<author>
<name>David Xu</name>
<email>davidxu@FreeBSD.org</email>
</author>
<published>2010-09-13T07:03:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a9b764e218bfdbf5f746d64ff503348a2363db6e'/>
<id>urn:sha1:a9b764e218bfdbf5f746d64ff503348a2363db6e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add signal handler wrapper, the reason to add it becauses there are</title>
<updated>2010-09-01T02:18:33Z</updated>
<author>
<name>David Xu</name>
<email>davidxu@FreeBSD.org</email>
</author>
<published>2010-09-01T02:18:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=02c3c85869f7ceee39a6e721b02df49714b49867'/>
<id>urn:sha1:02c3c85869f7ceee39a6e721b02df49714b49867</id>
<content type='text'>
some cases we want to improve:
  1) if a thread signal got a signal while in cancellation point,
     it is possible the TDP_WAKEUP may be eaten by signal handler
     if the handler called some interruptibly system calls.
  2) In signal handler, we want to disable cancellation.
  3) When thread holding some low level locks, it is better to
     disable signal, those code need not to worry reentrancy,
     sigprocmask system call is avoided because it is a bit expensive.
The signal handler wrapper works in this way:
  1) libthr installs its signal handler if user code invokes sigaction
     to install its handler, the user handler is recorded in internal
     array.
  2) when a signal is delivered, libthr's signal handler is invoke,
     libthr checks if thread holds some low level lock or is in critical
     region, if it is true, the signal is buffered, and all signals are
     masked, once the thread leaves critical region, correct signal
     mask is restored and buffered signal is processed.
  3) before user signal handler is invoked, cancellation is temporarily
     disabled, after user signal handler is returned, cancellation state
     is restored, and pending cancellation is rescheduled.
</content>
</entry>
</feed>
