<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/lib/replace/system/threads.h, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>replace: add checks for atomic_thread_fence(memory_order_seq_cst) and add possible fallbacks</title>
<updated>2018-07-24T15:38:26+00:00</updated>
<author>
<name>Stefan Metzmacher</name>
<email>metze@samba.org</email>
</author>
<published>2018-06-21T12:17:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=5fa5764f30c47b46f12ceb7637985e8def0190ca'/>
<id>5fa5764f30c47b46f12ceb7637985e8def0190ca</id>
<content type='text'>
This implements a full memory barrier.
On ubuntu amd64 with results in an 'mfence' instruction.

This is required to syncronization between threads, where
there's typically only one write of a memory that should be
synced between all threads with the barrier.

Much more details can be found here:
https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/_005f_005fatomic-Builtins.html#g_t_005f_005fatomic-Builtins
https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/_005f_005fsync-Builtins.html#g_t_005f_005fsync-Builtins

The main one we use seems to be in C11 via stdatomic.h,
the oldest fallback is __sync_synchronize(), which is available
since 2005 in gcc.

Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This implements a full memory barrier.
On ubuntu amd64 with results in an 'mfence' instruction.

This is required to syncronization between threads, where
there's typically only one write of a memory that should be
synced between all threads with the barrier.

Much more details can be found here:
https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/_005f_005fatomic-Builtins.html#g_t_005f_005fatomic-Builtins
https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/_005f_005fsync-Builtins.html#g_t_005f_005fsync-Builtins

The main one we use seems to be in C11 via stdatomic.h,
the oldest fallback is __sync_synchronize(), which is available
since 2005 in gcc.

Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/replace: fix PTHREAD_MUTEX_ROBUST fallback to PTHREAD_MUTEX_ROBUST_NP on solaris 11</title>
<updated>2015-06-12T15:08:20+00:00</updated>
<author>
<name>Stefan Metzmacher</name>
<email>metze@samba.org</email>
</author>
<published>2015-06-12T09:01:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=34cf1d213ec0261af41ef6a16f5b37e5015c614b'/>
<id>34cf1d213ec0261af41ef6a16f5b37e5015c614b</id>
<content type='text'>
Without this we got the following defines in config.h:

   #define HAVE_DECL_PTHREAD_MUTEXATTR_SETROBUST_NP 1
   #define HAVE_DECL_PTHREAD_MUTEX_CONSISTENT_NP 1
   #define HAVE_PTHREAD_MUTEXATTR_SETROBUST 1
   #define HAVE_PTHREAD_MUTEX_CONSISTENT 1
   #define HAVE_ROBUST_MUTEXES 1
   #define USE_TDB_MUTEX_LOCKING 1

And the build failed with PTHREAD_MUTEX_ROBUST being unknown.

Note that PTHREAD_MUTEX_ROBUST and PTHREAD_MUTEX_ROBUST_NP are enum values
while they're defines on solaris 11
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11319

Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Michael Adam &lt;obnox@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without this we got the following defines in config.h:

   #define HAVE_DECL_PTHREAD_MUTEXATTR_SETROBUST_NP 1
   #define HAVE_DECL_PTHREAD_MUTEX_CONSISTENT_NP 1
   #define HAVE_PTHREAD_MUTEXATTR_SETROBUST 1
   #define HAVE_PTHREAD_MUTEX_CONSISTENT 1
   #define HAVE_ROBUST_MUTEXES 1
   #define USE_TDB_MUTEX_LOCKING 1

And the build failed with PTHREAD_MUTEX_ROBUST being unknown.

Note that PTHREAD_MUTEX_ROBUST and PTHREAD_MUTEX_ROBUST_NP are enum values
while they're defines on solaris 11
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11319

Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Michael Adam &lt;obnox@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libreplace: Define PTHREAD_MUTEX_ROBUST along with pthread_mutexattr_setrobust</title>
<updated>2014-05-22T19:05:15+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2013-02-06T11:16:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=549338ff38e8689666890348d678bec7e1b0fe5e'/>
<id>549338ff38e8689666890348d678bec7e1b0fe5e</id>
<content type='text'>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libreplace: Add support for pthread_mutex_consistent</title>
<updated>2014-05-22T19:05:15+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2013-02-04T11:26:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=4ea036c26dd921c4fce18db3e54f551e9f856a07'/>
<id>4ea036c26dd921c4fce18db3e54f551e9f856a07</id>
<content type='text'>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libreplace: Add support for pthread_mutexattr_setrobust</title>
<updated>2014-05-22T19:05:15+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2012-12-22T07:42:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=1993f605a4452087e49ae552dc85aa940e827e20'/>
<id>1993f605a4452087e49ae552dc85aa940e827e20</id>
<content type='text'>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
