Commit 5c6f1295 authored by Marvin Scholz's avatar Marvin Scholz

input: Add initializer to avoid PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP

parent c915bced
......@@ -36,7 +36,8 @@ int input_rate;
int input_ch;
int input_size;
pthread_mutex_t input_mutex=PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
pthread_mutex_t input_mutex;
pthread_mutexattr_t input_mutex_attr;
typedef struct {
FILE *f;
......@@ -77,6 +78,12 @@ static feedback_generic_pool feedpool;
static time_linkage out;
void input_init() {
pthread_mutexattr_init(&input_mutex_attr);
pthread_mutexattr_settype(&input_mutex_attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&input_mutex, &input_mutex_attr);
}
void input_Acursor_set(off_t c){
pthread_mutex_lock(&input_mutex);
Acursor=c;
......
......@@ -21,6 +21,8 @@
*
*/
extern void input_init();
extern void input_Acursor_set(off_t c);
extern void input_Bcursor_set(off_t c);
extern off_t input_time_to_cursor(const char *t);
......
......@@ -232,6 +232,8 @@ int main(int argc, char **argv){
/* Init sub-components */
feedback_init();
window_init();
input_init();
version=strstr(VERSION,"version.h");
if(version){
char *versionend=strchr(version,' ');
......@@ -254,6 +256,7 @@ int main(int argc, char **argv){
its better to ignore other traps in production than to crash the
app. Please inform the FPU of this. */
/*
#ifndef DEBUG
fedisableexcept(FE_INVALID);
fedisableexcept(FE_INEXACT);
......@@ -265,6 +268,7 @@ int main(int argc, char **argv){
feenableexcept(FE_UNDERFLOW);
feenableexcept(FE_OVERFLOW);
#endif
*/
/* Linux Altivec support has a very annoying problem; by default,
math on denormalized floats will simply crash the program. FFTW3
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment