Using pthreads, I created a thread that does audio recording through shell:
void *thread_function(void *arg) {
system("arecord data.wav");
}
However, when I call pthread_cancel(&thread_ID);
to terminate the thread, the audio recorder still works on its own (Until I terminate the whole C program of course).
How do I stop a pthread that does a system call? Thanks in advance!