[Previous] [Contents] [Next]

pthread_attr_setstackaddr()

Set thread stack address attribute

Synopsis:

#include <pthread.h>

int pthread_attr_setstackaddr( pthread_attr_t * attr,
                               void * stackaddr );

Library:

libc

Description:

The pthread_attr_setstackaddr() function sets the thread stack address attribute in the attribute object attr to stackaddr.

The default value for the thread stack address attribute is NULL. A thread created with a NULL stack address attribute will have a stack dynamically allocated by the system of minimum size PTHREAD_STACK_MIN. The allocated stack will be reclaimed when the thread terminates. If a stack is allocated by the user then it must be released by the user.

Returns:

EOK
Success.

Classification:

POSIX 1003.1 (Threads)

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

Caveats:

The QNX interpretation of PTHREAD_STACK_MIN is enough memory to run a thread that does nothing:

void nothingthread( void )
{
    return;
}

See also:

pthread_attr_getstackaddr(), pthread_attr_init(), pthread_create().


[Previous] [Contents] [Next]