00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- 00002 00003 // -- BEGIN LICENSE BLOCK ---------------------------------------------- 00004 // This file is part of FZIs ic_workspace. 00005 // 00006 // This program is free software licensed under the LGPL 00007 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3). 00008 // You can find a copy of this license in LICENSE folder in the top 00009 // directory of the source code. 00010 // 00011 // © Copyright 2014 FZI Forschungszentrum Informatik, Karlsruhe, Germany 00012 // 00013 // -- END LICENSE BLOCK ------------------------------------------------ 00014 00015 //---------------------------------------------------------------------- 00030 //---------------------------------------------------------------------- 00031 #ifndef ICL_CORE_THREAD_THREAD_IMPL_LXRT35_H_INCLUDED 00032 #define ICL_CORE_THREAD_THREAD_IMPL_LXRT35_H_INCLUDED 00033 00034 #include <rtai_posix.h> 00035 00036 #include <icl_core/os_thread.h> 00037 00038 #include "icl_core_thread/ThreadImpl.h" 00039 00040 namespace icl_core { 00041 namespace thread { 00042 00043 class Thread; 00044 00049 class ThreadImplLxrt35 : public ThreadImpl, protected virtual icl_core::Noncopyable 00050 { 00051 public: 00052 ThreadImplLxrt35(Thread *thread, const icl_core::String& description, 00053 icl_core::ThreadPriority priority); 00054 00055 virtual ~ThreadImplLxrt35(); 00056 00057 virtual void cancel(); 00058 virtual icl_core::String getDescription() const { return m_description; } 00059 virtual bool isHardRealtime() const; 00060 virtual bool executesHardRealtime() const; 00061 virtual void join(); 00062 virtual icl_core::ThreadPriority priority() const; 00063 virtual void setDescription(const icl_core::String& description) { m_description = description; } 00064 virtual bool setHardRealtime(bool hard_realtime); 00065 virtual bool setPriority(icl_core::ThreadPriority priority); 00066 virtual bool start(); 00067 virtual icl_core::ThreadId threadId() const; 00068 00069 private: 00070 static void *runThread(void *arg); 00071 00072 pthread_t m_thread_id; 00073 Thread *m_thread; 00074 ThreadPriority m_priority; 00075 icl_core::String m_description; 00076 00077 RT_TASK *m_rt_task; 00078 00079 pthread_barrier_t *m_rt_start_sync; 00080 }; 00081 00082 } 00083 } 00084 00085 #endif