os_posix_thread.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 //----------------------------------------------------------------------
22 //----------------------------------------------------------------------
24 
25 #include "icl_core/os_lxrt.h"
26 
27 #ifdef _SYSTEM_LXRT_
28 # include <stdlib.h>
29 # include <rtai_lxrt.h>
30 # include <rtai_posix.h>
31 #endif
32 
33 namespace icl_core {
34 namespace os {
35 namespace hidden_posix {
36 
37 bool operator == (const ThreadId& left, const ThreadId& right)
38 {
39 #ifdef _SYSTEM_LXRT_
40  if (isThisLxrtTask())
41  {
42  return pthread_equal_rt(left.m_thread_id, right.m_thread_id);
43  }
44  else
45 #endif
46  {
47  return pthread_equal(left.m_thread_id, right.m_thread_id);
48  }
49 }
50 
52 {
53 #ifdef _SYSTEM_LXRT_
54  if (isThisLxrtTask())
55  {
56  return ThreadId(pthread_self_rt());
57  }
58  else
59 #endif
60  {
61  return ThreadId(pthread_self());
62  }
63 }
64 
66 {
68 }
69 
70 }
71 }
72 }
ICL_CORE_OS_IMPL_NS::ThreadId ThreadId
Definition: os_thread.h:49
Posix implementation of the global thread functions.
bool operator==(const ThreadId &left, const ThreadId &right)
Contains global LXRT functions.
bool isThisLxrtTask()
Definition: os_lxrt.cpp:150


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