Skip to contentSkip to conversation

native: Do not acquire non-existent MPS fastlock

PATCH In review Jan Kiszka 1 participant 1 message Jun 30, 2011

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/2 native: Do not acquire non-existent MPS fastlock

Fix a build warning at this chance as well.

---

Applies on top of xenomai-gch.git gch/u_mode

 ksrc/skins/native/task.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
ksrc/skins/native/task.c +6 -1
index da4e626..af62d56 100644
@@ -256,7 +256,9 @@ void __native_task_pkg_cleanup(void)
 int rt_task_create(RT_TASK *task,
 		   const char *name, int stksize, int prio, int mode)
 {
+#if defined(CONFIG_XENO_OPT_NATIVE_MPS) && defined(CONFIG_XENO_FASTSYNCH)
 	xnarch_atomic_t *fastlock = NULL;
+#endif
 	union xnsched_policy_param param;
 	struct xnthread_init_attr attr;
 	int err = 0, cpumask, cpu;
@@ -336,8 +338,11 @@ int rt_task_create(RT_TASK *task,
 		xnheap_free(&xnsys_ppd_get(0)->sem_heap, fastlock);
 #endif
 		xnpod_delete_thread(&task->thread_base);
-	} else
+	}
+#if defined(CONFIG_XENO_OPT_NATIVE_MPS) && defined(CONFIG_XENO_FASTSYNCH)
+	else
 		xnsynch_fast_acquire(fastlock, xnthread_handle(&task->thread_base));
+#endif
 
 	return err;
 }
Signature · 1 line
1.7.1