rem: while(ecasound_fiommap_buffermap[fd]->ready_for_fill[0] == true) {
add: while(ecasound_fiommap_spinlock == true || ecasound_fiommap_buffermap[fd]->ready_for_fill[0] == true) {
context: void ecasound_fiommap_next_buffer(int fd) {  //  cerr << "(eca-fileio-mmap-fthread) next_buffer()\n";  pthread_mutex_lock(&ecasound_fiommap_lock);  if (ecasound_fiommap_buffermap[fd]->locked_buffer == 0) {    pthread_cond_signal(&ecasound_fiommap_cond);    while(ecasound_fiommap_buffermap[fd]->ready_for_fill[1] == true) {      pthread_cond_wait(&ecasound_fiommap_cond,			&ecasound_fiommap_lock);    }    ecasound_fiommap_buffermap[fd]->locked_buffer = 1;    ecasound_fiommap_buffermap[fd]->ready_for_fill[0] = true;  }  else if (ecasound_fiommap_buffermap[fd]->locked_buffer == 1) {    pthread_cond_signal(&ecasound_fiommap_cond);    while(ecasound_fiommap_buffermap[fd]->ready_for_fill[0] == true) {      pthread_cond_wait(&ecasound_fiommap_cond,			&ecasound_fiommap_lock);    }    ecasound_fiommap_buffermap[fd]->locked_buffer = 0;    ecasound_fiommap_buffermap[fd]->ready_for_fill[1] = true;  }  pthread_cond_signal(&ecasound_fiommap_cond);  pthread_mutex_unlock(&ecasound_fiommap_lock);}