Index: trunk/lib/FlairCore/src/FrameworkManager_impl.cpp
===================================================================
--- trunk/lib/FlairCore/src/FrameworkManager_impl.cpp	(revision 112)
+++ trunk/lib/FlairCore/src/FrameworkManager_impl.cpp	(revision 118)
@@ -37,4 +37,5 @@
 #ifdef __XENO__
 #include <native/task.h>
+#include <rtdk.h>
 #endif
 
@@ -119,9 +120,14 @@
   sa.sa_flags = SA_SIGINFO;
   sigaction(SIGDEBUG, &sa, NULL);
-#else
+#else //SIGDEBUG
   signal(SIGXCPU, warn_upon_switch);
-#endif
-
+#endif //SIGDEBUG
   string task_name = "Framework_" + name;
+
+  // Perform auto-init of rt_print buffers if the task doesn't do so
+  rt_print_auto_init(1);
+  // Initialise the rt_print buffer for this task explicitly
+  rt_print_init(512, task_name.c_str());
+
   int status = rt_task_shadow(NULL, task_name.c_str(), 10, 0);
   if (status != 0) {
Index: trunk/lib/FlairCore/src/Semaphore.cpp
===================================================================
--- trunk/lib/FlairCore/src/Semaphore.cpp	(revision 118)
+++ trunk/lib/FlairCore/src/Semaphore.cpp	(revision 118)
@@ -0,0 +1,38 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/11/16
+//  filename:   Semaphore.cpp
+//
+//  author:     Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a semaphore
+//
+//
+/*********************************************************************/
+
+#include "Semaphore.h"
+#include "Semaphore_impl.h"
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+Semaphore::Semaphore(const Object *parent, uint32_t initialValue, string name)
+    : Object(parent, name, "semaphore") {
+  pimpl_ = new Semaphore_impl(this, initialValue);
+}
+
+Semaphore::~Semaphore() { delete pimpl_; }
+
+void Semaphore::GetSemaphore(void) const { pimpl_->GetSemaphore(); }
+
+void Semaphore::ReleaseSemaphore(void) const { pimpl_->ReleaseSemaphore(); }
+
+} // end namespace core
+} // end namespace flair
Index: trunk/lib/FlairCore/src/Semaphore.h
===================================================================
--- trunk/lib/FlairCore/src/Semaphore.h	(revision 118)
+++ trunk/lib/FlairCore/src/Semaphore.h	(revision 118)
@@ -0,0 +1,72 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Semaphore.h
+ * \brief Class defining a semaphore
+ * \author Thomas Fuhrmann, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/11/16
+ * \version 1.0
+ */
+
+#ifndef SEMAPHORE_H
+#define SEMAPHORE_H
+
+#include <Object.h>
+
+class Semaphore_impl;
+class ConditionVariable_impl;
+
+namespace flair {
+namespace core {
+
+/*! \class Semaphore
+*
+* \brief Class defining a semaphore
+*
+*/
+class Semaphore : public Object {
+  friend class ::ConditionVariable_impl;
+
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a semaphore.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  Semaphore(const Object *parent, uint32_t initialValue, std::string name = "");
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Semaphore();
+
+  /*!
+  * \brief GetSemaphore
+  *
+  * Lock the semaphore.
+  *
+  */
+  void GetSemaphore(void) const;
+
+  /*!
+  * \brief ReleaseSemaphore
+  *
+  * Unlock the semaphore.
+  *
+  */
+  void ReleaseSemaphore(void) const;
+
+private:
+  class Semaphore_impl *pimpl_;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // SEMAPHORE_H
Index: trunk/lib/FlairCore/src/Semaphore_impl.cpp
===================================================================
--- trunk/lib/FlairCore/src/Semaphore_impl.cpp	(revision 118)
+++ trunk/lib/FlairCore/src/Semaphore_impl.cpp	(revision 118)
@@ -0,0 +1,70 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/11/16
+//  filename:   Semaphore_impl.cpp
+//
+//  author:     Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a semaphore implementation
+//
+//
+/*********************************************************************/
+
+#include "Semaphore.h"
+#include "Semaphore_impl.h"
+
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+
+Semaphore_impl::Semaphore_impl(Semaphore *self, uint32_t initialValue) {
+  this->self = self;
+  int status;
+#ifdef __XENO__
+  status = rt_sem_create(&semaphore, NULL, initialValue, S_FIFO);
+#else
+  status = sem_init(&semaphore, 0, initialValue);
+#endif
+  if (status != 0) {
+    self->Err("error creating semaphore (%s)\n", strerror(-status));
+  }
+}
+
+Semaphore_impl::~Semaphore_impl() {
+  int status;
+#ifdef __XENO__
+  status = rt_sem_delete(&semaphore);
+#else
+  status = sem_destroy(&semaphore);
+#endif
+  if (status != 0)
+    self->Err("error destroying semaphore (%s)\n", strerror(-status));
+}
+
+void Semaphore_impl::GetSemaphore(void) {
+  int status;
+#ifdef __XENO__
+  status = rt_sem_p(&semaphore, TM_INFINITE);
+#else
+  status = sem_wait(&semaphore);
+#endif
+  if (status != 0)
+    self->Err("error getting the semaphore (%s)\n", strerror(-status));
+}
+
+void Semaphore_impl::ReleaseSemaphore(void) {
+  int status;
+#ifdef __XENO__
+  status = rt_sem_v(&semaphore);
+#else
+  status = sem_post(&semaphore);
+#endif
+  if (status != 0)
+    self->Err("error releasing the semaphore (%s)\n", strerror(-status));
+}
Index: trunk/lib/FlairCore/src/Thread_impl.cpp
===================================================================
--- trunk/lib/FlairCore/src/Thread_impl.cpp	(revision 112)
+++ trunk/lib/FlairCore/src/Thread_impl.cpp	(revision 118)
@@ -26,9 +26,10 @@
 #ifdef __XENO__
 #include <rtdk.h>
-#else
+#define TH_NAME getFrameworkManager()->ObjectName() + "-" + self->ObjectName()
+#else//__XENO__
 #include <sys/resource.h>
 #include <unistd.h>
 #include <sys/syscall.h>
-#endif
+#endif//__XENO__
 
 using std::string;
@@ -61,4 +62,11 @@
   last = 0;
   cpt = 0;
+
+#ifdef __XENO__
+  // Perform auto-init of rt_print buffers if the task doesn't do so
+  rt_print_auto_init(1);
+    // Initialise the rt_print buffer for this task explicitly
+  rt_print_init(512, (TH_NAME).c_str());
+#endif //__XENO__
 }
 
@@ -76,6 +84,5 @@
 
 #ifdef __XENO__
-  string th_name =
-      getFrameworkManager()->ObjectName() + "-" + self->ObjectName();
+  string th_name =TH_NAME;
 
 #ifdef RT_STACK_SIZE
@@ -99,7 +106,4 @@
   }
 
-  // Initialise the rt_print buffer for this task explicitly
-  rt_print_init(512, th_name.c_str());
-
 #else //__XENO__
 
@@ -146,7 +150,4 @@
 void Thread_impl::main_rt(void *arg) {
   Thread_impl *caller = (Thread_impl *)arg;
-
-  // Perform auto-init of rt_print buffers if the task doesn't do so
-  rt_print_auto_init(1);
 
   caller->self->Run();
Index: trunk/lib/FlairCore/src/unexported/Semaphore_impl.h
===================================================================
--- trunk/lib/FlairCore/src/unexported/Semaphore_impl.h	(revision 118)
+++ trunk/lib/FlairCore/src/unexported/Semaphore_impl.h	(revision 118)
@@ -0,0 +1,44 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Semaphore_impl.h
+ * \brief Class defining a semaphore implementation
+ * \author Thomas Fuhrmann, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/11/16
+ * \version 1.0
+ */
+
+#ifndef SEMAPHORE_IMPL_H
+#define SEMAPHORE_IMPL_H
+
+#ifdef __XENO__
+#include <native/sem.h>
+#else
+#include <semaphore.h>
+#endif
+
+namespace flair {
+namespace core {
+class Semaphore;
+}
+}
+
+class Semaphore_impl {
+public:
+  Semaphore_impl(flair::core::Semaphore *self, uint32_t initialValue);
+  ~Semaphore_impl();
+  void GetSemaphore(void);
+  void ReleaseSemaphore(void);
+#ifdef __XENO__
+  RT_SEM semaphore;
+#else
+  sem_t semaphore;
+#endif
+
+private:
+  flair::core::Semaphore *self;
+};
+
+#endif // SEMAPHORE_IMPL_H
