Mercurial > hg > CbC > CbC_gcc
annotate libitm/testsuite/libitm.c/simple-1.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* Verify that two sequential runs of a transaction will complete and |
2 produce correct results. An early test of the library did in fact | |
3 leave things in an inconsistent state following the commit of the | |
4 first transaction. */ | |
5 | |
6 #include <stdlib.h> | |
7 | |
8 static int x; | |
9 | |
10 static void start (void) | |
11 { | |
12 __transaction_atomic { x++; } | |
13 } | |
14 | |
15 int main() | |
16 { | |
17 start (); | |
18 start (); | |
19 | |
20 if (x != 2) | |
21 abort (); | |
22 | |
23 return 0; | |
24 } |