thread_pool_control()
QNX SDP8.0C Library ReferenceAPIDeveloper
Control the thread pool behavior
Synopsis:
#include <sys/iofunc.h>
#include <sys/dispatch.h>
thread_pool_control( thread_pool_t * pool,
                     thread_pool_attr_t * attr,
                     uint16_t lower,
                     uint16_t upper,
                     unsigned flags )
Arguments:
- pool
 - A thread pool handle that was returned by thread_pool_create().
 - attr
 - A pointer to a thread_pool_attr_t structure that
  specifies the attributes that you want to use for the thread pool.
  For more information, see
  
Thread-pool attributes,
in the documentation for thread_pool_create(). - lower, upper
 - This function blocks until the number of threads created is strictly between the range of upper and lower, unless you set THREAD_POOL_CONTROL_NONBLOCK in flags.
 - flags
 - Which attributes you want to change for the thread pool; any combination
  of the following bits:
  
- THREAD_POOL_CONTROL_HIWATER — adjust the high-water value of the number of threads allowed in the thread pool.
 - THREAD_POOL_CONTROL_INCREMENT — adjust the increment value of the number of threads.
 - THREAD_POOL_CONTROL_LOWATER — adjust the low-water value of the number of threads allowed in the thread pool.
 - THREAD_POOL_CONTROL_MAXIMUM — adjust the maximum value of the number of threads allowed in the thread pool.
 - THREAD_POOL_CONTROL_NONBLOCK — don't block while creating threads.
 
 
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
Use thread_pool_control() to specify a thread pool's behavior and adjust its attributes.
Returns:
- EOK
 - Success.
 - -1
 - An error occurred (errno is set).
 
Errors:
- EAGAIN
 - A thread for this pool couldn't be created or the context for a thread couldn't be allocated.
 - EINVAL
 - The requested lower number of threads to create (lower) is greater than the requested upper number (upper).
 
Classification:
| Safety: | |
|---|---|
| Cancellation point | Yes | 
| Signal handler | No | 
| Thread | Yes | 
Page updated: 
