Changeset 8c5267a in rtems


Ignore:
Timestamp:
Oct 10, 2017, 5:11:29 AM (18 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
4f9ed26
Parents:
da9f5f1
Message:

posix: Simplify pthread_attr_setstack()

Simplify

  • pthread_attr_setstack(), and
  • pthread_attr_setstacksize().

Update #2514.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/pthreadattrsetstack.c

    rda9f5f1 r8c5267a  
    2323#if HAVE_DECL_PTHREAD_ATTR_SETSTACK
    2424
    25 #include <rtems/posix/pthreadimpl.h>
    26 #include <rtems/score/stackimpl.h>
    27 
    2825#include <pthread.h>
    2926#include <errno.h>
     
    3835    return EINVAL;
    3936
    40   if (stacksize < PTHREAD_MINIMUM_STACK_SIZE)
    41     attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE;
    42   else
    43     attr->stacksize = stacksize;
    44 
     37  attr->stacksize = stacksize;
    4538  attr->stackaddr = stackaddr;
    4639  return 0;
  • cpukit/posix/src/pthreadattrsetstacksize.c

    rda9f5f1 r8c5267a  
    2121#endif
    2222
    23 #include <rtems/posix/pthreadimpl.h>
    24 #include <rtems/score/stackimpl.h>
    25 
    2623#include <pthread.h>
    2724#include <errno.h>
     
    3532    return EINVAL;
    3633
    37   if (stacksize < PTHREAD_MINIMUM_STACK_SIZE)
    38     attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE;
    39   else
    40     attr->stacksize = stacksize;
     34  attr->stacksize = stacksize;
    4135  return 0;
    4236}
  • testsuites/psxtests/psxgetattrnp01/init.c

    rda9f5f1 r8c5267a  
    4848    return 1;
    4949
    50   if ( attr1->stacksize != attr2->stacksize )
     50  if (
     51    attr1->stacksize != 0 &&
     52      attr2->stacksize != 0 &&
     53       attr1->stacksize != attr2->stacksize )
    5154    return 1;
    5255
Note: See TracChangeset for help on using the changeset viewer.