X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker-benchmarks.git;a=blobdiff_plain;f=mpmc-queue%2Fmpmc-queue.cc;h=741811aaf357578bc0d0056d4ce4272f66881dc8;hp=17713cbfb5f3f162a91c2117e7907b11abe21681;hb=40b27f40998eed81640b016094bacf79df96d377;hpb=a2eed12e68f117e513577ca8177cc6c9787f5bb4 diff --git a/mpmc-queue/mpmc-queue.cc b/mpmc-queue/mpmc-queue.cc index 17713cb..741811a 100644 --- a/mpmc-queue/mpmc-queue.cc +++ b/mpmc-queue/mpmc-queue.cc @@ -25,7 +25,7 @@ void threadB(struct mpmc_boundq_1_alt *queue) int user_main(int argc, char **argv) { struct mpmc_boundq_1_alt queue; - thrd_t A, B; + thrd_t A1, A2, B1, B2; int32_t *bin = queue.write_prepare(); store_32(bin, 17); @@ -33,10 +33,14 @@ int user_main(int argc, char **argv) printf("Start threads\n"); - thrd_create(&A, (thrd_start_t)&threadA, &queue); - thrd_create(&B, (thrd_start_t)&threadB, &queue); - thrd_join(A); - thrd_join(B); + thrd_create(&A1, (thrd_start_t)&threadA, &queue); + thrd_create(&A2, (thrd_start_t)&threadA, &queue); + thrd_create(&B1, (thrd_start_t)&threadB, &queue); + thrd_create(&B2, (thrd_start_t)&threadB, &queue); + thrd_join(A1); + thrd_join(A2); + thrd_join(B1); + thrd_join(B2); printf("Threads complete\n");