Commit a70faf30 authored by Marvin Scholz's avatar Marvin Scholz

feedback: Add initializer to avoid PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP

parent 04666b5b
......@@ -24,7 +24,14 @@
#include "postfish.h"
#include "feedback.h"
static pthread_mutex_t feedback_mutex=PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static pthread_mutex_t feedback_mutex;
static pthread_mutexattr_t feedback_mutex_attr;
void feedback_init() {
pthread_mutexattr_init(&feedback_mutex_attr);
pthread_mutexattr_settype(&feedback_mutex_attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&feedback_mutex, &feedback_mutex_attr);
}
feedback_generic *feedback_new(feedback_generic_pool *pool,
feedback_generic *(*constructor)(void)){
......
......@@ -31,6 +31,8 @@ typedef struct feedback_generic_pool{
feedback_generic *feedback_pool;
} feedback_generic_pool;
extern void feedback_init();
extern feedback_generic *feedback_new(feedback_generic_pool *pool,
feedback_generic *(*constructor)(void));
extern void feedback_push(feedback_generic_pool *pool,
......
......@@ -229,6 +229,8 @@ void sigill_handler(int sig){
int main(int argc, char **argv){
int wisdom=0;
/* Init sub-components */
feedback_init();
version=strstr(VERSION,"version.h");
if(version){
char *versionend=strchr(version,' ');
......
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