1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/lib/replace/system
Stefan Metzmacher 5fa5764f30 replace: add checks for atomic_thread_fence(memory_order_seq_cst) and add possible fallbacks
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 <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2018-07-24 17:38:26 +02:00
..
aio.h
capability.h Revert "replace: Try to fix broken sys/capabilites.h on Linux." 2011-02-03 04:32:43 +01:00
dir.h replace: Include libgen.h if available 2016-12-01 18:08:54 +01:00
filesys.h build: bundle and reduce huge number of EA function tests 2018-07-03 13:24:51 +02:00
glob.h
gssapi.h Introduce system MIT krb5 build with --with-system-mitkrb5 option. 2012-05-23 17:51:50 +03:00
iconv.h
kerberos.h lib/replace: split out GSSAPI from lib/replace/system/kerberos.h into lib/replace/system/gssapi.h 2012-04-25 00:18:32 +02:00
locale.h
network.h replace: make sure we have a SCOPE_DELIMITER define 2016-12-09 16:58:11 +01:00
nis.h include: Create system/nis.h in libreplace 2018-01-22 12:26:20 +01:00
passwd.h replace: Fix includes of unistd.h 2014-09-19 18:11:11 +02:00
readline.h lib/replace: apply readline -Wstrict-prototypes workaround 2017-11-24 05:16:10 +01:00
README
select.h Add Solaris ports as a tevent backend. 2015-02-15 23:25:07 +01:00
shmem.h
syslog.h
terminal.h
threads.h replace: add checks for atomic_thread_fence(memory_order_seq_cst) and add possible fallbacks 2018-07-24 17:38:26 +02:00
time.h libbreplace: compatibility fix for AIX 2017-06-13 09:11:56 +02:00
wait.h lib:replace: Missing semicolon on function definition. 2016-04-02 06:04:13 +02:00
wscript_configure replace: remove some duplicate checks 2018-02-21 14:19:17 +01:00

This directory contains wrappers around logical groups of system
include files. The idea is to avoid #ifdef blocks in the main code,
and instead put all the necessary conditional includes in subsystem
specific header files in this directory.