From fb5331881b1b1466de8d3aee0716bbb9b11085f8 Mon Sep 17 00:00:00 2001 From: Maschell Date: Wed, 4 Apr 2018 15:39:27 +0200 Subject: [PATCH] Added GetThreadAffinity function to the CThread class. --- source/system/AsyncDeleter.cpp | 5 +++-- source/system/CThread.h | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/source/system/AsyncDeleter.cpp b/source/system/AsyncDeleter.cpp index b8484a6..f9e5baf 100644 --- a/source/system/AsyncDeleter.cpp +++ b/source/system/AsyncDeleter.cpp @@ -28,8 +28,9 @@ AsyncDeleter::~AsyncDeleter() { } void AsyncDeleter::triggerDeleteProcess(void) { - if(!deleterInstance) - deleterInstance = new AsyncDeleter; + if(!deleterInstance){ + return; + } //! to trigger the event after GUI process is finished execution //! this function is used to swap elements from one to next array diff --git a/source/system/CThread.h b/source/system/CThread.h index fa9904d..bf484f0 100644 --- a/source/system/CThread.h +++ b/source/system/CThread.h @@ -91,6 +91,13 @@ public: virtual bool isThreadRunning(void) const { return !isThreadSuspended() && !isThreadRunning(); } + + //! Gets the thread affinity. + virtual u16 getThreadAffinity(void) const { + if(pThread) return OSGetThreadAffinity(pThread); + return 0; + } + //! Shutdown thread virtual void shutdownThread(void) { //! wait for thread to finish