From ef01b7814064e6847ce8e90ea00e8ea09bb36111 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Sat, 6 Jun 2020 15:01:57 +0200 Subject: [PATCH] some issue with stack size .. --- osal/linux/PeriodicPosixTask.cpp | 3 ++- osal/linux/PosixThread.cpp | 3 +++ osal/linux/PosixThread.h | 19 +++++++++++-------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/osal/linux/PeriodicPosixTask.cpp b/osal/linux/PeriodicPosixTask.cpp index f6a74901c..df5bbf930 100644 --- a/osal/linux/PeriodicPosixTask.cpp +++ b/osal/linux/PeriodicPosixTask.cpp @@ -38,7 +38,8 @@ ReturnValue_t PeriodicPosixTask::sleepFor(uint32_t ms) { ReturnValue_t PeriodicPosixTask::startTask(void){ started = true; - createTask(&taskEntryPoint,this); + //sif::info << stackSize << std::endl; + PosixThread::createTask(&taskEntryPoint,this); return HasReturnvaluesIF::RETURN_OK; } diff --git a/osal/linux/PosixThread.cpp b/osal/linux/PosixThread.cpp index cfc3ed4dd..5f91858f5 100644 --- a/osal/linux/PosixThread.cpp +++ b/osal/linux/PosixThread.cpp @@ -128,6 +128,9 @@ void PosixThread::createTask(void* (*fnc_)(void*), void* arg_) { default attributes. */ pthread_attr_t attributes; + //PeriodicPosixTask* task = reinterpret_cast(arg_); + //sif::info << task->stackSize << std::endl; + sif::info << stackSize << std::endl; int status = pthread_attr_init(&attributes); if(status != 0){ sif::error << "Posix Thread attribute init failed with: " << diff --git a/osal/linux/PosixThread.h b/osal/linux/PosixThread.h index f10352b45..ad403ac4f 100644 --- a/osal/linux/PosixThread.h +++ b/osal/linux/PosixThread.h @@ -54,14 +54,17 @@ protected: pthread_t thread; /** - * @brief Function that has to be called by derived class because the derived class pointer has to be valid as argument - * @details This function creates a pthread with the given parameters. As the function requires a pointer to the derived object - * it has to be called after the this pointer of the derived object is valid. Sets the taskEntryPoint as - * function to be called by new a thread. - * @param name_ Name of the task - * @param priority_ Priority of the task according to POSIX - * @param stackSize_ Size of the stack attached to that task - * @param arg_ argument of the taskEntryPoint function, needs to be this pointer of derived class + * @brief Function that has to be called by derived class because the + * derived class pointer has to be valid as argument + * @details + * This function creates a pthread with the given parameters. As the + * function requires a pointer to the derived object it has to be called + * after the this pointer of the derived object is valid. + * Sets the taskEntryPoint as function to be called by new a thread. + * @param fnc_ Function which will be executed by the thread. + * @param arg_ + * argument of the taskEntryPoint function, needs to be this pointer + * of derived class */ void createTask(void* (*fnc_)(void*),void* arg_);