<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test2/include/pthread.h, branch release/11.0.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F11.0.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F11.0.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/'/>
<updated>2016-05-17T09:56:22Z</updated>
<entry>
<title>Add implementation of robust mutexes, hopefully close enough to the</title>
<updated>2016-05-17T09:56:22Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2016-05-17T09:56:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=2a339d9e3dc129f0b0b79c2cb8d2bb0386fb0f5f'/>
<id>urn:sha1:2a339d9e3dc129f0b0b79c2cb8d2bb0386fb0f5f</id>
<content type='text'>
intention of the POSIX IEEE Std 1003.1TM-2008/Cor 1-2013.

A robust mutex is guaranteed to be cleared by the system upon either
thread or process owner termination while the mutex is held.  The next
mutex locker is then notified about inconsistent mutex state and can
execute (or abandon) corrective actions.

The patch mostly consists of small changes here and there, adding
neccessary checks for the inconsistent and abandoned conditions into
existing paths.  Additionally, the thread exit handler was extended to
iterate over the userspace-maintained list of owned robust mutexes,
unlocking and marking as terminated each of them.

The list of owned robust mutexes cannot be maintained atomically
synchronous with the mutex lock state (it is possible in kernel, but
is too expensive).  Instead, for the duration of lock or unlock
operation, the current mutex is remembered in a special slot that is
also checked by the kernel at thread termination.

Kernel must be aware about the per-thread location of the heads of
robust mutex lists and the current active mutex slot.  When a thread
touches a robust mutex for the first time, a new umtx op syscall is
issued which informs about location of lists heads.

The umtx sleep queues for PP and PI mutexes are split between
non-robust and robust.

Somewhat unrelated changes in the patch:
1. Style.
2. The fix for proper tdfind() call use in umtxq_sleep_pi() for shared
   pi mutexes.
3. Removal of the userspace struct pthread_mutex m_owner field.
4. The sysctl kern.ipc.umtx_vnode_persistent is added, which controls
   the lifetime of the shared mutex associated with a vnode' page.

Reviewed by:	jilles (previous version, supposedly the objection was fixed)
Discussed with:	brooks, Martin Simmons &lt;martin@lispworks.com&gt; (some aspects)
Tested by:	pho
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-test2/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>Make use of gcc attributes in some standard include headers.</title>
<updated>2015-04-06T01:39:16Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2015-04-06T01:39:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=153cbcd6579a5c285e7f384c09211b081bb800c4'/>
<id>urn:sha1:153cbcd6579a5c285e7f384c09211b081bb800c4</id>
<content type='text'>
The `nonnull' attribute specifies that some function parameters should be
non-null pointers.  This is very useful as it helps the compiler generate
warnings on suspicious code and can also enable some small optimizations.

Also start using 'alloc_size' attribute in the allocator functions.

This is an initial step to better integrate our libc with the compiler:
these attributes are fully supported by clang and they are also useful
for the static analyzer.

Note that due to some bogus internal procedure in the way gcc ports
are built they may require updating if they were built before r280801.

Relnotes:		yes
Hinted by:		Android's bionic libc
Differential Revision:	https://reviews.freebsd.org/D2107
</content>
</entry>
<entry>
<title>Clean some spaces vs tabs.</title>
<updated>2015-03-29T20:20:45Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2015-03-29T20:20:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=4b069c8287c8e47cd98143a334aa91791026d2f4'/>
<id>urn:sha1:4b069c8287c8e47cd98143a334aa91791026d2f4</id>
<content type='text'>
No, this file doesn't conform with KNF at all.
</content>
</entry>
<entry>
<title>Temporarily revert 280458.</title>
<updated>2015-03-25T21:53:17Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2015-03-25T21:53:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=28cdb3ee1548da44cb5319fc93f6c2fa59531ae4'/>
<id>urn:sha1:28cdb3ee1548da44cb5319fc93f6c2fa59531ae4</id>
<content type='text'>
GCC is still carries an old version of cdefs.h which doesn't
accept multiple parameters for the nonnull attribute.

Since this issue probably affects many ports in the tree
we will revert it for now until gcc gets fixed.
</content>
</entry>
<entry>
<title>Introduce nonnull attributes in the signal and pthread headers.</title>
<updated>2015-03-24T20:33:24Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2015-03-24T20:33:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=512cd1357ad02e6f7ac037013367b9dea2ed194a'/>
<id>urn:sha1:512cd1357ad02e6f7ac037013367b9dea2ed194a</id>
<content type='text'>
The `nonnull' attribute specifies that some function parameters should be
non-null pointers.  This is very useful as it helps the compiler generate
warnings on suspicious code and can also enable some small optimizations.
In clang this is also useful for the static analyzer.

While we could go on defining this all over the tree, it only
makes sense to annotate a subset of critical functions.

Hinted by:		Android's bionic libc
Differential Revision:	https://reviews.freebsd.org/D2101
</content>
</entry>
<entry>
<title>Add lock annotations to the header files of our threading libraries.</title>
<updated>2014-09-01T18:34:30Z</updated>
<author>
<name>Ed Schouten</name>
<email>ed@FreeBSD.org</email>
</author>
<published>2014-09-01T18:34:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=49891e45d2411861e1d976964f281dd1baf37823'/>
<id>urn:sha1:49891e45d2411861e1d976964f281dd1baf37823</id>
<content type='text'>
This change extends all of the functions present in the &lt;pthread.h&gt; and
&lt;threads.h&gt; headers to have lock annotations. This will allow Clang to
warn about the following:

- Locking a function twice,
- Unlocking a function without a mutex being locked,
- Forgetting to unlock a mutex before returning,
- Destroying or reinitializing a mutex that is currenty locked,
- Using an unlocked mutex in combination with a condition variable.

Enabling these annotations already allowed me to catch a bug in one of
our userspace tools (r270749).
</content>
</entry>
<entry>
<title>Add a dummy statement to the beginning of the pthread_cleanup_pop() macro</title>
<updated>2013-10-22T19:53:52Z</updated>
<author>
<name>Tijl Coosemans</name>
<email>tijl@FreeBSD.org</email>
</author>
<published>2013-10-22T19:53:52Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=23bbf7fa70060d04e9c4789d790066648a0ca892'/>
<id>urn:sha1:23bbf7fa70060d04e9c4789d790066648a0ca892</id>
<content type='text'>
to allow a call of the macro to be labelled as in:

label:
  pthread_cleanup_pop();

Reviewed by:	imp
MFC after:	3 days
</content>
</entry>
<entry>
<title>Remove leftover for r214093.</title>
<updated>2011-01-06T03:30:16Z</updated>
<author>
<name>David Xu</name>
<email>davidxu@FreeBSD.org</email>
</author>
<published>2011-01-06T03:30:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=f66ffe64ceeaab88c60e0f148bd71eb1d82573b0'/>
<id>urn:sha1:f66ffe64ceeaab88c60e0f148bd71eb1d82573b0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add pthread_rwlockattr_setkind_np and pthread_rwlockattr_getkind_np, the</title>
<updated>2010-10-18T05:09:22Z</updated>
<author>
<name>David Xu</name>
<email>davidxu@FreeBSD.org</email>
</author>
<published>2010-10-18T05:09:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=a6b9b59e0486667a43fda2ab77a7a053c820c2d9'/>
<id>urn:sha1:a6b9b59e0486667a43fda2ab77a7a053c820c2d9</id>
<content type='text'>
functions set or get pthread_rwlock type, current supported types are:
   PTHREAD_RWLOCK_PREFER_READER_NP,
   PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
   PTHREAD_RWLOCK_PREFER_WRITER_NP,
default is PTHREAD_RWLOCK_PREFER_WRITER_NONCECURSIVE_NP, this maintains
binary compatible with old code.
</content>
</entry>
</feed>
