F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
TaskCommon.cpp
Go to the documentation of this file.
1#include <Os/Task.hpp>
2#include <Fw/Types/Assert.hpp>
3#include <FpConfig.hpp>
4
5
6namespace Os {
7 const NATIVE_UINT_TYPE Task::TASK_DEFAULT = std::numeric_limits<PlatformUIntType>::max();
8
9 TaskRegistry* Task::s_taskRegistry = nullptr;
10 NATIVE_INT_TYPE Task::s_numTasks = 0;
11
13 return Task::s_numTasks;
14 }
15
16
18 return m_identifier;
19 }
20
22 return this->m_started;
23 }
24
25 void Task::setStarted(bool started) {
26 this->m_started = started;
27 }
28
30 return this->m_suspendedOnPurpose;
31 }
32
34 return this->m_handle;
35 }
36
38 FW_ASSERT(registry);
39 Task::s_taskRegistry = registry;
40 }
41
43
44 }
45
46 Task::TaskStatus Task::start(const Fw::StringBase &name, NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, taskRoutine routine, void* arg, NATIVE_INT_TYPE cpuAffinity) {
47 return this->start(name, routine, arg, priority, stackSize, cpuAffinity, identifier);
48 }
49
51
52 }
53
54}
#define FW_ASSERT(...)
Definition Assert.hpp:7
PlatformPointerCastType POINTER_CAST
Definition BasicTypes.h:53
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
C++-compatible configuration header for fprime configuration.
bool wasSuspended()
returns whether or not task was suspended on purpose
I32 getIdentifier()
get the identifier for the task
static const NATIVE_UINT_TYPE TASK_DEFAULT
Definition Task.hpp:17
TaskStatus
Definition Task.hpp:18
bool isStarted()
check to see if task is started
static void registerTaskRegistry(TaskRegistry *registry)
void setStarted(bool started)
set task to started when thread is fully up. Avoids a VxWorks race condition.
POINTER_CAST getRawHandle()
TaskStatus start(const Fw::StringBase &name, taskRoutine routine, void *arg, NATIVE_UINT_TYPE priority=TASK_DEFAULT, NATIVE_UINT_TYPE stackSize=TASK_DEFAULT, NATIVE_UINT_TYPE cpuAffinity=TASK_DEFAULT, NATIVE_UINT_TYPE identifier=TASK_DEFAULT)
start the task
Definition Task.cpp:18
static NATIVE_INT_TYPE getNumTasks()
TaskRegistry()
constructor for task registry
virtual ~TaskRegistry()
destructor for task registry
Definition File.cpp:6