Skip to content

Commit

Permalink
Fixes #175 - Adds additional stack size for RT thread as a CMake
Browse files Browse the repository at this point in the history
parameter

Signed-off-by: Martin Melik-Merkumians <[email protected]>
  • Loading branch information
MartinMelikMerkumians committed Jan 14, 2019
1 parent acea92a commit 011f42b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/src/ports/POSIX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ set( PLATFORM_SPEC_SRC networkhandler.c opener_error.c networkconfig.c)
#######################################
set( OpENer_RT OFF CACHE BOOL "Activate OpENer RT" )
if(OpENer_RT)
set( OpENer_RT_Additional_Stacksize "10240" CACHE STRING "Additional stack size above the defined minimum")
add_definitions( -DOPENER_RT )
add_definitions(-DOPENER_RT_THREAD_SIZE=${OpENer_RT_Additional_Stacksize})
endif(OpENer_RT)

#######################################
Expand Down
3 changes: 2 additions & 1 deletion source/src/ports/POSIX/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ int main(int argc,
}

/* Set stack size */
ret = pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN);
ret = pthread_attr_setstacksize(&attr,
PTHREAD_STACK_MIN + OPENER_RT_THREAD_SIZE);
if (ret) {
OPENER_TRACE_ERR("setstacksize failed\n");
exit(-2);
Expand Down

0 comments on commit 011f42b

Please sign in to comment.