Index: branches/semaphore/lib/FlairCore/src/Semaphore.cpp
===================================================================
--- branches/semaphore/lib/FlairCore/src/Semaphore.cpp	(revision 117)
+++ branches/semaphore/lib/FlairCore/src/Semaphore.cpp	(revision 117)
@@ -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: branches/semaphore/lib/FlairCore/src/Semaphore.h
===================================================================
--- branches/semaphore/lib/FlairCore/src/Semaphore.h	(revision 117)
+++ branches/semaphore/lib/FlairCore/src/Semaphore.h	(revision 117)
@@ -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: branches/semaphore/lib/FlairCore/src/Semaphore_impl.cpp
===================================================================
--- branches/semaphore/lib/FlairCore/src/Semaphore_impl.cpp	(revision 117)
+++ branches/semaphore/lib/FlairCore/src/Semaphore_impl.cpp	(revision 117)
@@ -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: branches/semaphore/lib/FlairCore/src/unexported/Semaphore_impl.h
===================================================================
--- branches/semaphore/lib/FlairCore/src/unexported/Semaphore_impl.h	(revision 117)
+++ branches/semaphore/lib/FlairCore/src/unexported/Semaphore_impl.h	(revision 117)
@@ -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
