Get the thread suspend state attribute
#include <pthread.h> int pthread_attr_getsuspendstate_np( const pthread_attr_t* attr, int* suspend );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The pthread_attr_getsuspendstate_np() function gets the thread suspend state attribute from the thread attribute object attr and returns it in suspend. You can use pthread_attr_setsuspendstate_np() to set the suspend state attribute.
The np in these functions' names stands for non-POSIX.
Starting a thread in a suspended state is the equivalent of creating a thread and immediately calling ThreadCtlExt(), specifying the thread ID and the _NTO_TCTL_ONE_THREAD_HOLD command. You can unsuspend the thread with the _NTO_TCTL_ONE_THREAD_CONT command.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |