Add a ring buffer implementation.

This is intented to replace the pipe between the writer and reader 
threads. That way we can have a much better control of cancelation 
situations. Still to be optimized.
This commit is contained in:
Vreixo Formoso
2007-12-23 02:24:21 +01:00
parent 9ec475a900
commit 94e687d9d3
6 changed files with 463 additions and 3 deletions

View File

@ -705,8 +705,8 @@ int ecma119_image_new(IsoImage *src, Ecma119WriteOpts *opts,
pthread_attr_init(&(target->th_attr));
pthread_attr_setdetachstate(&(target->th_attr), PTHREAD_CREATE_JOINABLE);
ret = pthread_create(&(target->wthread), NULL, write_function,
(void *) target);
ret = pthread_create(&(target->wthread), &(target->th_attr),
write_function, (void *) target);
if (ret != 0) {
iso_msg_fatal(target->image, LIBISO_THREAD_ERROR,
"Cannot create writer thread");