MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / Thread

Class Thread

TactilityKernel/source/concurrent/thread.cpp:16–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14static const char* TAG = "Thread";
15
16struct Thread {
17 TaskHandle_t taskHandle = nullptr;
18 ThreadState state = THREAD_STATE_STOPPED;
19 thread_main_fn_t mainFunction = nullptr;
20 void* mainFunctionContext = nullptr;
21 int32_t callbackResult = 0;
22 thread_state_callback_t stateCallback = nullptr;
23 void* stateCallbackContext = nullptr;
24 std::string name = "unnamed";
25 enum ThreadPriority priority = THREAD_PRIORITY_NORMAL;
26 struct Mutex mutex = { 0 };
27 configSTACK_DEPTH_TYPE stackSize = 4096;
28 portBASE_TYPE affinity = -1;
29
30 Thread() {
31 mutex_construct(&mutex);
32 }
33
34 ~Thread() {
35 mutex_destruct(&mutex);
36 }
37
38 void lock() { mutex_lock(&mutex); }
39
40 void unlock() { mutex_unlock(&mutex); }
41};
42
43static void thread_set_state_internal(Thread* thread, ThreadState newState) {
44 thread->lock();

Callers 3

MutexTest.cppFile · 0.50
BootAppClass · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected