Browse code

Merge branch 'master' of https://github.com/spotrh/preprocessCore into spotrh-master

Ben Bolstad authored on 01/02/2020 17:43:11
Showing4 changed files

... ...
@@ -37,13 +37,13 @@
37 37
 #include "median.h"
38 38
 
39 39
 #include "medianpolish.h"
40
+#include "common.h"
40 41
 
41 42
 #ifdef USE_PTHREADS
42 43
 #include <pthread.h>
43 44
 #include <limits.h>
44 45
 #include <unistd.h>
45 46
 #define THREADS_ENV_VAR "R_THREADS"
46
-pthread_mutex_t mutex_R;
47 47
 struct loop_data{
48 48
   double *matrix;
49 49
   double *results;
... ...
@@ -26,7 +26,7 @@
26 26
 #include "rlm_se.h"
27 27
 #include "psi_fns.h"
28 28
 #include "medianpolish.h"
29
-
29
+#include "common.h"
30 30
 
31 31
 
32 32
 
... ...
@@ -37,7 +37,6 @@
37 37
 #include <limits.h>
38 38
 #include <unistd.h>
39 39
 #define THREADS_ENV_VAR "R_THREADS"
40
-pthread_mutex_t mutex_R;
41 40
 struct loop_data{
42 41
   double *matrix;
43 42
   SEXP *R_return_value;
44 43
new file mode 100644
... ...
@@ -0,0 +1,9 @@
1
+#ifndef COMMON_H
2
+#define COMMON_H 1
3
+
4
+#ifdef USE_PTHREADS
5
+#include <pthread.h>
6
+extern pthread_mutex_t mutex_R;
7
+#endif
8
+
9
+#endif
... ...
@@ -44,13 +44,13 @@
44 44
 
45 45
 #include "weightedkerneldensity.h"
46 46
 #include "rma_background4.h"
47
+#include "common.h"
47 48
 
48 49
 #ifdef USE_PTHREADS
49 50
 #include <pthread.h>
50 51
 #include <limits.h>
51 52
 #include <unistd.h>
52 53
 #define THREADS_ENV_VAR "R_THREADS"
53
-pthread_mutex_t mutex_R;
54 54
 struct loop_data{
55 55
   double *data;
56 56
   size_t rows;