From c0da78bf868c2a23dff6df6e8780b79f98e09275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 18 Mar 2024 17:45:15 +0100 Subject: [PATCH 1/3] Make maxthreads settable at compile time --- ThreadController.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ThreadController.h b/ThreadController.h index 2ed46a3..08d03d9 100644 --- a/ThreadController.h +++ b/ThreadController.h @@ -19,7 +19,9 @@ #include "Thread.h" #include "inttypes.h" +#ifndef MAX_THREADS #define MAX_THREADS 32 +#endif class ThreadController: public Thread{ protected: From e7500e72c1e9d21ba327b9b9fc685ad150939ec3 Mon Sep 17 00:00:00 2001 From: Eric Severance Date: Thu, 26 Dec 2024 10:22:46 -0800 Subject: [PATCH 2/3] Fix NULL pointer dereference in ThreadController::remove --- ThreadController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThreadController.cpp b/ThreadController.cpp index 68ea202..f1ad0e2 100644 --- a/ThreadController.cpp +++ b/ThreadController.cpp @@ -105,7 +105,7 @@ bool ThreadController::add(Thread* _thread){ void ThreadController::remove(size_t id){ // Find Threads with the id, and removes for(int i = 0; i < MAX_THREADS; i++){ - if(thread[i]->ThreadID == id){ + if(thread[i] && thread[i]->ThreadID == id){ thread[i] = NULL; cached_size--; return; From 29797eaa5f6d853ac203ca5c3e2718fd20af2459 Mon Sep 17 00:00:00 2001 From: vidplace7 Date: Sat, 8 Mar 2025 13:53:43 -0500 Subject: [PATCH 3/3] Add Headers definitions, align name with Arduino Lib --- library.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library.json b/library.json index 975f790..38c1466 100644 --- a/library.json +++ b/library.json @@ -1,12 +1,13 @@ { - "name": "Thread", + "name": "ArduinoThread", "keywords": "thread, task", - "description": "A library for managing the periodic execution of multiple tasks", + "description": "A library for managing the periodic execution of multiple tasks. Forked from ivanseidel/ArduinoThread", "repository": { "type": "git", - "url": "https://github.com/ivanseidel/ArduinoThread.git" + "url": "https://github.com/meshtastic/ArduinoThread.git" }, "frameworks": "arduino", + "headers": ["Thread.h", "ThreadController.h","StaticThreadController.h"], "platforms": "atmelavr" }