Browse Source

include/: when compiling with visual studio, do not include pthread.h, do not define functions using pthread types, and define pthread variables as void * (followup to #3304)

Nathalie Furmento 14 years ago
parent
commit
7b59581779
2 changed files with 9 additions and 4 deletions
  1. 1 3
      include/starpu_scheduler.h
  2. 8 1
      include/starpu_task_bundle.h

+ 1 - 3
include/starpu_scheduler.h

@@ -111,9 +111,7 @@ 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
+#if !defined(_MSC_VER)
 void starpu_worker_set_sched_condition(int workerid, pthread_cond_t *sched_cond, pthread_mutex_t *sched_mutex);
 #endif
 

+ 8 - 1
include/starpu_task_bundle.h

@@ -19,7 +19,10 @@
 
 #include <starpu.h>
 #include <starpu_config.h>
-#include <pthread.h>
+
+#if ! defined(_MSC_VER)
+#  include <pthread.h>
+#endif
 
 struct starpu_task_bundle_entry {
 	struct starpu_task *task;
@@ -30,7 +33,11 @@ struct starpu_task_bundle_entry {
  * together whenever possible. */
 struct starpu_task_bundle {
 	/* Mutex protecting the bundle */
+#if defined(_MSC_VER)
+	void *mutex;
+#else
 	pthread_mutex_t mutex;
+#endif
 	/* last worker previously assigned a task from the bundle (-1 if none) .*/
 	int previous_workerid;
 	/* list of tasks */