Commit c915bced authored by Marvin Scholz's avatar Marvin Scholz

window: Add initializer to avoid PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP

parent a70faf30
......@@ -231,6 +231,7 @@ int main(int argc, char **argv){
/* Init sub-components */
feedback_init();
window_init();
version=strstr(VERSION,"version.h");
if(version){
char *versionend=strchr(version,' ');
......
......@@ -25,7 +25,8 @@
#include "window.h"
#include "compat.h"
static pthread_mutex_t window_mutex=PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static pthread_mutex_t window_mutex;
static pthread_mutexattr_t window_mutex_attr;
static float ***window_func=0; /* sin(), sin()^2, sin(sin()^2),sin(sin^2)^2
1,2,4,8,16,32,64,128,256,512,1024,
......@@ -46,6 +47,12 @@ static int ilog(long x){
return ret;
}
void window_init() {
pthread_mutexattr_init(&window_mutex_attr);
pthread_mutexattr_settype(&window_mutex_attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&window_mutex, &window_mutex_attr);
}
float *window_get(int type,int n){
int bits=ilog(n),i;
if((1<<bits)!=n)return 0;
......
......@@ -21,5 +21,6 @@
*
*/
extern void window_init();
extern float *window_get(int type,int n);
extern void window_apply(float *data, float *window, float scale, int halfn);
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