We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
struct data_race_test : rl::test_suite<data_race_test, 2>{ rl::atomic<int> ff; rl::atomic<int> nexec; void before(){ nexec($) = 0; ff($) = 0; } void thread(unsigned id){ if(id == 0){ // Thread 0 if(ff($)==0){ // 1. 7. ff($)++; // 2 ff=1. 8 ff=1. nexec($)++; // 3 exec=1. 9 exec=2. assertions1(); // 6. 10 **must fail but doesnt!** }else{ ff($)++; } }else if(id == 1){ // Thread 1 if(nexec($)>0){ // 4. ff($)--; // 5 ff=0. if(ff($)==0){ nexec($)--; assertions1(); } } } } void assertions1(){ int ex = nexec($); RL_ASSERT(ex >= 0 && ex<=1); } }; int main(){ rl::test_params p; p.search_type = rl::sched_full; //p.iteration_count = 1000000; rl::simulate<data_race_test>(p); }
data_race_test iterations: 41 total time: 1 throughput: 41000
The text was updated successfully, but these errors were encountered:
No branches or pull requests
data_race_test
iterations: 41
total time: 1
throughput: 41000
The text was updated successfully, but these errors were encountered: