pthread_attr_setstacksize()

Set the thread stack-size attribute

Synopsis:

#include <pthread.h>

int pthread_attr_setstacksize( pthread_attr_t * attr,
                               size_t stacksize );

Since:

BlackBerry 10.0.0

Arguments:

attr
A pointer to the pthread_attr_t structure that defines the attributes to use when creating new threads. For more information, see pthread_attr_init().
stacksize
The size of the stack you want to use in new threads. The minimum value of the thread stack-size attribute is PTHREAD_STACK_MIN.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The pthread_attr_setstacksize() function sets the thread stack size attribute in the thread attribute object attr to stacksize.

The system uses some of the provided stack for objects such as thread local storage and an initial stack frame, so less than the entire buffer is available to the thread.

Returns:

EOK
Success.
EINVAL
The value of stacksize is less than PTHREAD_STACK_MIN or greater than the system limit.

Classification:

POSIX 1003.1 THR TSS

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

Caveats:

The BlackBerry 10 OS interpretation of PTHREAD_STACK_MIN is enough memory to run a thread that does nothing:

void nothingthread( void )
{
    return;
}

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus