1R1W mode fixed

This commit is contained in:
ha7ilm 2016-06-07 22:15:40 +02:00
parent 5064d3b72c
commit 91c91425de

View file

@ -8,6 +8,7 @@ tsmpool::tsmpool(size_t size, int num)
this->ok = 1; this->ok = 1;
this->lowest_read_index = -1; this->lowest_read_index = -1;
this->write_index = 0; this->write_index = 0;
this->my_read_index = 0;
if (pthread_mutex_init(&this->mutex, NULL) != 0) this->ok=0; if (pthread_mutex_init(&this->mutex, NULL) != 0) this->ok=0;
} }
@ -51,7 +52,3 @@ void* tsmpool::get_read_buffer(tsmthread_t* thread)
void* to_return = buffers[*actual_read_index]; void* to_return = buffers[*actual_read_index];
*actual_read_index=index_next(*actual_read_index); *actual_read_index=index_next(*actual_read_index);
} }
void* tsmpool::set_read_index_distance(tsmthread_t* thread, int distance)
{
}