ソースを参照

include: when compiling with visual studio c++, do not include pthread.h (it does not exist), and replace pthread types with void*

Nathalie Furmento 14 年 前
コミット
511e71c851
共有2 個のファイルを変更した16 個の追加2 個の削除を含む
  1. 8 1
      include/starpu_perfmodel.h
  2. 8 1
      include/starpu_scheduler.h

+ 8 - 1
include/starpu_perfmodel.h

@@ -20,10 +20,13 @@
 
 #include <starpu_config.h>
 #include <stdio.h>
-#include <pthread.h>
 #include <starpu.h>
 #include <starpu_task.h>
 
+#if ! defined(_MSC_VER)
+#  include <pthread.h>
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -105,7 +108,11 @@ struct starpu_perfmodel_t {
 	unsigned is_loaded;
 	unsigned benchmarking;
 
+#if defined(_MSC_VER)
+	void *model_rwlock;
+#else
 	pthread_rwlock_t model_rwlock;
+#endif
 };
 
 /* This function is intended to be used by external tools that should read the

+ 8 - 1
include/starpu_scheduler.h

@@ -19,7 +19,10 @@
 
 #include <starpu.h>
 #include <starpu_config.h>
-#include <pthread.h>
+
+#if ! defined(_MSC_VER)
+#  include <pthread.h>
+#endif
 
 #ifdef STARPU_HAVE_HWLOC
 #include <hwloc.h>
@@ -108,7 +111,11 @@ multiple workers may use the same condition variable. For instance, in the case
 of a scheduling strategy with a single task queue, the same condition variable
 would be used to block and wake up all workers.  The initialization method of a
 scheduling strategy (init_sched) must call this function once per worker. */
+#if defined(_MSC_VER)
+void starpu_worker_set_sched_condition(int workerid, void **sched_cond, void **sched_mutex);
+#else
 void starpu_worker_set_sched_condition(int workerid, pthread_cond_t *sched_cond, pthread_mutex_t *sched_mutex);
+#endif
 
 /* Check if the worker specified by workerid can execute the codelet. */
 int starpu_worker_may_execute_task(unsigned workerid, struct starpu_task *task);