|
|
|
@ -144,6 +144,8 @@ main(int argc, char *argv[])
|
|
|
|
|
assert(thread);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < nthr; i++) {
|
|
|
|
|
ck_fifo_spsc_entry_t *garbage;
|
|
|
|
|
|
|
|
|
|
context[i].tid = i;
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
context[i].previous = nthr - 1;
|
|
|
|
@ -156,6 +158,9 @@ main(int argc, char *argv[])
|
|
|
|
|
context[i].previous = i - 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ck_fifo_spsc_init(fifo + i, malloc(sizeof(ck_fifo_spsc_entry_t)));
|
|
|
|
|
ck_fifo_spsc_deinit(fifo + i, &garbage);
|
|
|
|
|
free(garbage);
|
|
|
|
|
ck_fifo_spsc_init(fifo + i, malloc(sizeof(ck_fifo_spsc_entry_t)));
|
|
|
|
|
r = pthread_create(thread + i, NULL, test, context + i);
|
|
|
|
|
assert(r == 0);
|
|
|
|
@ -166,3 +171,4 @@ main(int argc, char *argv[])
|
|
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|