projects
/
model-checker-benchmarks.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
revert the RCU benchmark back with atomic variables
[model-checker-benchmarks.git]
/
read-copy-update
/
rcu.h
1
#ifndef _RCU_H
2
#define _RCU_H
3
4
#include <atomic>
5
#include <threads.h>
6
#include <stdatomic.h>
7
#include <stdlib.h>
8
#include <stdio.h>
9
10
#include "librace.h"
11
12
struct Data {
13
// Declare atomic to expose them to CDSChecker.
14
// Otherwise, we might miss the data race reports.
15
atomic_int data1;
16
atomic_int data2;
17
};
18
19
20
extern atomic<Data*> dataPtr;
21
22
void read(int *data1, int *data2);
23
24
void write(int data1, int data2);
25
26
#endif