icl_core_logging/SemaphoreImplLxrt38.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
21 //----------------------------------------------------------------------
22 #include "SemaphoreImplLxrt38.h"
23 
24 namespace icl_core {
25 namespace logging {
26 
28  : m_semaphore(NULL)
29 {
30  m_semaphore = rt_typed_sem_init(size_t(this), initial_value, CNT_SEM | PRIO_Q);
31 }
32 
34 {
35  if (m_semaphore == NULL)
36  {
37  // Nothing to be done here!
38  }
39  else
40  {
41  rt_sem_delete(m_semaphore);
42  m_semaphore = NULL;
43  }
44 }
45 
47 {
48  rt_sem_signal(m_semaphore);
49 }
50 
52 {
53  int res = rt_sem_wait(m_semaphore);
54  return (res < SEM_TIMOUT);
55 }
56 
57 }
58 }
Contains icl_core::logging::SemaphoreImplLxrt38.


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58