Browse Source

SOCL: fix StarPU's configuration (must not be a stack var)

Sylvain Henry 12 years ago
parent
commit
07b7432fc7
2 changed files with 4 additions and 4 deletions
  1. 2 2
      socl/src/init.c
  2. 2 2
      socl/src/init.h

+ 2 - 2
socl/src/init.c

@@ -24,12 +24,12 @@
 
 int _starpu_init_failed;
 int _starpu_init = 0;
-pthread_mutex_t _socl_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t _socl_mutex = PTHREAD_MUTEX_INITIALIZER;
+static struct starpu_conf conf;
 
 void socl_init_starpu(void) {
   pthread_mutex_lock(&_socl_mutex);
   if( ! _starpu_init ){
-    struct starpu_conf conf;
     starpu_conf_init(&conf);
     conf.ncuda = 0;
     conf.ncpus = 0;

+ 2 - 2
socl/src/init.h

@@ -23,8 +23,8 @@
 #ifndef SOCL_INIT_H
 #define SOCL_INIT_H
 
-extern int _starpu_init_failed;
-extern volatile int _starpu_init;
+int _starpu_init_failed;
+volatile int _starpu_init;
 /**
  * Initialize StarPU
  */