]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/builtins/atomic_flag_test_and_set_explicit.c
Update compiler-rt to 3.7.0 release. This also includes the sanitizer
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / builtins / atomic_flag_test_and_set_explicit.c
1 /*===-- atomic_flag_test_and_set_explicit.c ---------------------------------===
2  *
3  *                     The LLVM Compiler Infrastructure
4  *
5  * This file is dual licensed under the MIT and the University of Illinois Open
6  * Source Licenses. See LICENSE.TXT for details.
7  *
8  *===------------------------------------------------------------------------===
9  *
10  * This file implements atomic_flag_test_and_set_explicit from C11's stdatomic.h
11  *
12  *===------------------------------------------------------------------------===
13  */
14
15 #include <stdatomic.h>
16 #undef atomic_flag_test_and_set_explicit
17 _Bool atomic_flag_test_and_set_explicit(volatile atomic_flag *object,
18                                         memory_order order) {
19   return __c11_atomic_exchange(&(object)->_Value, 1, order);
20 }