MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / user_main

Function user_main

tests/CDSChecker/enqueue_dequeue_many.cpp:39–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39int user_main(int, char**)
40{
41 init();
42
43 // Start out as thread IDs, but are re-used by the threads
44 // to indicate the number of elements each one dequeued
45 int w = 1, x = 2, y = 3, z = 4;
46
47 thrd_t a, b, c, d;
48
49 thrd_create(&a, &producer, &w);
50 thrd_create(&b, &consumer, &x);
51 thrd_create(&c, &consumer, &y);
52 thrd_create(&d, &consumer, &z);
53
54 thrd_join(a);
55 thrd_join(b);
56 thrd_join(c);
57 thrd_join(d);
58
59 MODEL_ASSERT(w + x + y + z + size_approx() == 8);
60
61 return 0;
62}

Callers

nothing calls this directly

Calls 2

size_approxFunction · 0.85
initFunction · 0.70

Tested by

no test coverage detected