repo.or.cz
/
linux
/
fpc-iii.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
x86/speculation/mds: Fix documentation typo
[linux/fpc-iii.git]
/
tools
/
build
/
feature
/
test-sync-compare-and-swap.c
blob
1e38d1930a972a3a442c314eb1cf5a611bbe472d
1
// SPDX-License-Identifier: GPL-2.0
2
#include <stdint.h>
3
4
volatile
uint64_t
x
;
5
6
int
main
(
int
argc
,
char
*
argv
[])
7
{
8
uint64_t
old
,
new
=
argc
;
9
10
argv
=
argv
;
11
do
{
12
old
=
__sync_val_compare_and_swap
(&
x
,
0
,
0
);
13
}
while
(!
__sync_bool_compare_and_swap
(&
x
,
old
,
new
));
14
return
old
==
new
;
15
}