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