Skip to content

Commit

Permalink
Revert pthread_attr_setstacksize
Browse files Browse the repository at this point in the history
  • Loading branch information
chinglee-iot authored and paulbartell committed Jan 11, 2024
1 parent b6c0c51 commit 6222066
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions portable/ThirdParty/GCC/Posix/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,13 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
thread->pvParams = pvParameters;
thread->xDying = pdFALSE;

/* Ensure ulStackSize is at least PTHREAD_STACK_MIN */
ulStackSize = ( ulStackSize < PTHREAD_STACK_MIN ) ? PTHREAD_STACK_MIN : ulStackSize;

pthread_attr_init( &xThreadAttributes );
iRet = pthread_attr_setstacksize( &xThreadAttributes, ulStackSize );
iRet = pthread_attr_setstack( &xThreadAttributes, pxEndOfStack, ulStackSize );

if( iRet != 0 )
{
fprintf( stderr, "[WARN] pthread_attr_setstacksize failed with return value: %d. Default stack size will be used.\n", iRet );
fprintf( stderr, "[WARN] pthread_attr_setstack failed with return value: %d. Default stack will be used.\n", iRet );
fprintf( stderr, "[WARN] Increase the stack size to PTHREAD_STACK_MIN.\n" );
}

thread->ev = event_create();
Expand Down

0 comments on commit 6222066

Please sign in to comment.