Цитата
int jack_set_process_callback ( jack_client_t * client,
JackProcessCallback process_callback,
void * arg
)
Tell the Jack server to call process_callback whenever there is work be done, passing arg as the second argument.
The code in the supplied function must be suitable for real-time execution. That means that it cannot call functions that might block for a long time. This includes all I/O functions (disk, TTY, network), malloc, free, printf, pthread_mutex_lock, sleep, wait, poll, select, pthread_join, pthread_cond_wait, etc, etc.
JackProcessCallback process_callback,
void * arg
)
Tell the Jack server to call process_callback whenever there is work be done, passing arg as the second argument.
The code in the supplied function must be suitable for real-time execution. That means that it cannot call functions that might block for a long time. This includes all I/O functions (disk, TTY, network), malloc, free, printf, pthread_mutex_lock, sleep, wait, poll, select, pthread_join, pthread_cond_wait, etc, etc.
Итак, у меня два потока - GUI и поток обработки звука. Как ясно из первого сообщения, в потоке обработки звука нельзя пользоваться мьютексами и т.д. И есть как минимум пять переменных :
int shift_left;
float volume_left;
float volume_right
Filter *filter_left;
Filter *filter_right;
shift_left - текущая задержка левого канала,
volume_left, volume_right - громкость каналов.
GUI поток пишет значения этих переменных, поток обработки звука - читает. Как синхронизировать? Особенно интересуют объекты типа Filter...