projects
/
model-checker-benchmarks.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
b689936ae6918411da1c3192e28137ce122ca911
[model-checker-benchmarks.git]
/
spsc-queue
/
spsc-queue.cc
1
#include <threads.h>
2
3
#include "queue.h"
4
5
spsc_queue<int> q;
6
7
void thread(unsigned thread_index)
8
{
9
if (0 == thread_index)
10
{
11
q.enqueue(11);
12
}
13
else
14
{
15
int d = q.dequeue();
16
RL_ASSERT(11 == d);
17
}
18
}
19
20
int user_main(int argc, char **argv)
21
{
22
thrd_t A, B;
23
thrd_create(&A, (thrd_start_t)&thread, (void *)0);
24
thrd_create(&B, (thrd_start_t)&thread, (void *)1);
25
thrd_join(A);
26
thrd_join(B);
27
return 0;
28
}